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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wierd problem with LogOnServer

Status
Not open for further replies.

shankarpatil

Programmer
Feb 5, 2001
25
US
VB6,CR8,DB2 on AS400

I am using the following the code to connect to DB2 database thru VB6. When the propReport.SQLQueryString is executed the log-on dialog box is prompted for user-id and password.All the information is passed thru the SetLogOnInfo and the LogOnServer methods. Is there something wrong with the code or am I missing something.How do I suppress the log-on dialog box.



Dim tbl As CRAXDRT.DatabaseTable
Dim propReport As CRAXDRT.Report

Screen.MousePointer = vbHourglass

For Each tbl In propReport.Database.Tables
tbl.SetLogOnInfo g_DsnName, g_DsnName, g_UserId, g_Password
Next

propReport.Database.LogOnServer "pdsodbc.dll", g_DsnName,
g_DsnName, g_UserId, g_Password


propReport.SQLQueryString = propSQLString
propReport.FormulaFields(4).Text = "'" & UCase(Trim(propNetwork)) & "'"

CRViewer1.ReportSource = propReport
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
 
For one thing, I don't think you want to use the pd*.dll files. Those are the old 16-bit DLLs. Use p2*.dll.
 
What if you just go with the SQL in the report, without replacing it at runtime? Does it prompt you?

Are there any subreports? And, if so, when you do a Database / Set Location in the subreport does it point to a different server from the one you are connecting to in your code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top