Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SetLogonInfo with OLEDB - how?

Status
Not open for further replies.

mchoss

Programmer
Feb 11, 2002
87
GB
Crystal 8.5
Integration method: RDC component(CRAXDRT)
Visual Basic 6

My VB app attempts to open reports at runtime passing through selection criteria built from information from another application.

The reports were built using an ODBC connection, and i was opening them from VB into a Crystal Viewer using the LogonServer method:

crystalRpt.Database.LogOnServer "p2sodbc.dll",DSN,,UID,PWD

Which explicitly uses ODBC. I would like to use OLEDB as my connection method for a number of reasons but am encountering problems and fear that my code is incomplete:

Public crystalRpt As CRAXDRT.Report
Public crystalApp As CRAXDRT.Application

Set crystalApp = New CRAXDRT.Application
Set crystalRpt = crystalApp.OpenReport('my report')

For l_intCount = 1 To crystalRpt.Database.Tables.Count
crystalRpt.Database.Tables(l_intCount).SetLogOnInfo DSN, ,UID,PWD
Next l_intCount

I have been into my reports and used 'set location' to change the data source to use OLE DB .. however when this code runs, it still attempts to connect via ODBC.

LogonServer allows explicit declaration of the dll, what do i need to do to tell Setlogoninfo to use OLE DB at runtime?

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top