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

Link MS SQL server dynamically

Status
Not open for further replies.

ahhuang

Programmer
Apr 1, 2002
61
SG
I am using crystal report control to link vb & crystal report.
In my crystal report development, I used database "a".
however when i try to load the report using vb, my database is "b", n it loads database "a" data.
please advise why is this the problem and wat are the solutions.
Here are my coding:
cr1.ReportFileName="c:\db\sample.rpt"
cr1.LogOnServer "p2ssql.dll","servername","b","sa",""
cr1.action=1

thanx
 
In Crystal report, go to the Set Location menu and select the table, and remove the database reference to the table.

Now this rpt should work either you connect to Database a or Database b.

 
initially the provided solution provided by IT2003 works, but then recently i changed server n then my crystal report cannot run in VB again.
The message is "cannot open server", even i pass the server name as a variable name.
How can I solve this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top