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

Connect to SQL-server...?

Status
Not open for further replies.

kenjoswe

Technical User
Sep 19, 2000
327
0
0
SE
Hi all,

How do I connect Crystal Report to a SQL-server from VisualBasic in runtime?
This is how I connect VB to SQL-server:
conn.Open "Provider=sqloledb;" & _
"Data Source=ServerName;" & _
"Initial Catalog=DatabaseName;" & _
"User Id=UserId;" & _
"Password=PW;"

What is the syntax in Crystal Report? Report1.Connect?

/Kent J.



 
Try this:

Dim Application As CRAXDRT.Application
Dim Report As CRAXDRT.Report
Set Application = CreateObject("CrystalRuntime.Application")
Set Report = Application.OpenReport(ReportFile)
Report.Database.Tables(1).SetLogOnInfo "in01-sql03-nt", "QualityDevl", "[username]", "[password]"


Maybe this will help to get ya started.

Adam

 
OK! Thanks.

With:
Report.Database.Tables(1).SetLogOnInfo "in01-sql03-nt", "QualityDevl", "[username]", "[password]"

Do you mean?:
Report.Database.Tables(1).SetLogOnInfo "ServerName", "DatabaseName", "[username]", "[password]"

/Kent J.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top