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

Crystal Report with server logon

Status
Not open for further replies.

cuetzpalin

Programmer
Jun 5, 2002
99
0
0
US
Hello,

I have a crystal report that requires logging on to the sql server. I figured out how to set up my ado connection and the crystal viewer pops up, however I get an error that states that there is a problem with my data source. Do you know the code to pass the user name and password to the report?

Please help!

Thank you in advance,
C
 
you should have this in your code:

Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

Set mainReportTableCollection = Session("oRpt").Database.Tables

For Each mnTable in mainReportTableCollection
With mnTable.ConnectionProperties
.Item("user ID") = "youruserID"
.Item("Password") = "yourpassword"
.Item("DSN") = "yourDSN"
.Item("Database") ="yourDatabase"
End With
Next
 
Thanks for the reply. However the code fails on this line:
With mnTable.ConnectionProperties

Says property not allowed.

Also, should this code go before I open the database connection or after?

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top