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

"cannot open Sql Server" Error, Help me to sort out this

Status
Not open for further replies.
Aug 16, 2001
26
NZ
I needed to refresh my report data every time I print to include the new records entries which was made to my database. For this I turned off the save data option in Crystal Reports and tried logging onto the server from VB.

CrystalReports.LogOnServer "p2sodbc.dll", "a", "b", "c", "d"

Where a = my (ODBC) system dsn name
b = SQL SERVER database name
c = SQL SERVER authentication login id
d = password

But I'm getting a error

run time error : 20599
"cannot open Sql Server"

Somebody please help me in this and let me know where I'm going wrong.


 
I'd say that you either don't have the authorisation from the client machine (a long shot - but worth trying to access the SQL server database through something like Query Analyser to check). Alternatively it may be that the client machine may be missing one of the required DLL's for accessing the SL Server database (check these are included with the executable file using list in Seagate developer help files).
Hope this helps.
Steve
 
If you're using the RDC and your report object is Report1 then it should be Report1.Database.LogonServer

And..

If you're using an ODBC DSN, don' fill "B" - just put a comma. "A" is the server name, "B" is the database name. If you make "A" an ODBC DSN, you don't need "B".

And...

If you're using ADO, .LogonServer seems to have problems for some people. On Crystal's web site, they urge you to use .SetLogonInfo instead. The parameters are almost the same, just drop off the first one (the DLL parameter).

Report1.Database.Tables(1).SetLogonInfo "a", "b", "c", "d"
 
It worked atlast. I tried this way.

CrystalReports.LogOnServer "p2sodbc.dll", "a", "b", "c", "d"

Where a = my (ODBC) system dsn name
b = SQL SERVER database name
c = SQL SERVER authentication login id
d = password

Here I found that "a" should be case sensitive.

Thank you all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top