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

accessing a crystal report via MSDE (log on infos)

Status
Not open for further replies.

crisedefoie

Programmer
Feb 19, 2003
39
CA
Hello,
First I apologize for my english. I hope I'll be clear anyway.

I have to call a crystal report trough a MSDE connection.
When I call the same report with SQL Server my connection code works fine but I really don't know how to do with MSDE connection. I tried many different ways but they didn't works

This is my code (I simplified it for best reading)

With ConnectInfo
If ConnectType = MSDE Then
.ServerName = psServeurDadhri
.UserID = "login" ' Windows login
.Password = "password" 'Windows password
.DatabaseName = "Path" & DatabaseName
Else
.ServerName = psServeurDadhri
.UserID = login SQL Server
.Password = password SQL Server
.DatabaseName = "Path" & databaseName
End If
End with
tbCurrent.ApplyLogOnInfo(tliCurrent)
tbCurrent.Location() = Report.Database.Tables.Item(i).Name

Does someone know how to make it works?

Thanks in advance

Helie



 
MSDE IS Sql Server. The only difference between the two is that they would more than likely have different names. Also, what are you doing with the word path under your database name.
 
I'm sorry. I tought to do well simplifying my code but ...

Forget "PATH" here is my code.

Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo

For Each tbCurrent In prRapport.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
If gTypeConnectDadhri = BaseDonnees.ClsBaseDonnees.TTypeBD.MSDE Then
.ServerName = psServeurDadhri
.UserID = "3SYSDOMAIN\903"
.Password = "helie"
.DatabaseName = gClsUsager.lsCheminDadhri
Else
.ServerName = psServeurDadhri
.UserID = psUsagerDadhri
.Password = psMotPasseDadhri
.DatabaseName = gClsUsager.lsCheminDadhri
End If
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
tbCurrent.Location() = prRapport.Database.Tables.Item(i).Name
i = i + 1
Next tbCurrent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top