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

Default database is giving error

Status
Not open for further replies.

danielraj

Programmer
Mar 5, 2003
12
IN
hai all
While creating crystal report(RPT file) i had connected to a database for ex.USER01 and through that i had connected the stored procedure and i designed the database.
We are using crystal enterprise,i use to publish the RPT file through wizard and throught ASP i use to display the RPT file,and i use to pass the Database connection dynamically because while accessing the RPT file through ASP i won't connect to USER01 database,i may connect to USER02 or some other server.
its working well
If i give the RPT file to client ,he is saying that the RPT file is asking USER01,because my client won't have USER01,he may have RAJ as the server name.How to solve this problem,how to check this in my office
what i had done is i stop the USER01 server and pass the server name as USER02 for checking ,its working now.but my client is saying that the file is asking for "USER01 not found"
what to do give me solution for this

-----------------My Coding----------------
connectionstring="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=cpadmin;pwd=cpadmin;Initial Catalog=CP_Server;Data Source=user02"

set oConn = CreateObject("ADODB.Connection")
oConn.Open connectionstring
SqlStr = "exec proc_example"
Set ResultSet = oConn.Execute(SqlStr)

if(ResultSet.EOF=false) then
Session("oClientDoc").DatabaseController.setDataSource ResultSet, Session("oClientDoc").Database.Tables.Item(0).Alias, "ADORecordset"

oConn.Close
end if
-----------------
here is the code to change the database.
thank you in advance
 
You could have your code prompt for the server, and use the entered value in your connection string.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top