here are a steps how i Created report.
open new blank report and in Data Explorer:
1.ModeDataSoure
2.Microsoft SQL Server
3.DiaogBox appeared, i entered Servername and UserId and chouse the database name.
4 Drag and drop fields on the report.
In run time(vb6) I need to relogin to completely different SERVER(SQL Server) but with the same structure of DB tables
I'm using the code:
Dim tapp As CRAXDRT.Application
Dim treport As CRAXDDRT.Report
Dim crpTable As CRAXDDRT.DatabaseTable
Dim mservername as string
mservername= "MYServerNAme"
Set tapp = CreateObject("CrystalRuntime.Application"
Set treport = tapp.OpenReport(App.Path & "\External.rpt"
For Each crpTable In treport.Database.Tables
crpTable.SetLogOnInfo mserverName ,"Database", "User ID", "Password"
Next crpTable
'show report in Viewer
end sub
What's wrong with that? It does not work
Do you know any other way to accomplish this task??
Thanks for Help....