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!

Error:20599 Cannot Open Sql Server

Status
Not open for further replies.

RohanP

Programmer
Mar 6, 2002
50
IN
I had made a Exports Application in VB6,Sql Server7 & Crystal Reports 7 which was working fine but, I had to Format the Data Server for Virus reason & Configure Sql Server.

Configuration is perfectly done & Software is working fine but while accessing the reports on client machine i.e. on Setting action property to 1, it is giving an Error while opening Report file from VB.

Error:20599 Cannot Open Sql Server

I tried many things but nothing worked :(...
Pls help me out.. ______________________________
- Regards Rohan (India,Mumbai)
 
If you are attempting to open a predefined crystal report with the vb crystal report control, you probably need to supply a password like this:

cr2.Connect = "PWD=password"

The above assumes your vb - crystal control is named cr2,
password is self-explanatory. This should appear before you attempt to set the action property

 
This is the code I have written, even after connecting to the specified Database the same error flashes.

With preinvrep
.ReportFileName = App.Path & "\Reports\Pre_invoice.rpt"
.SubreportToChange = "BUYER_ORDNO"
.SubreportToChange = "FOR_ORDNO"
.SubreportToChange = "ADVDET"
.Connect = "dsn=SqlConn;uid=sa;pwd=dbserver;dsq=Exports"
.WindowTitle = "Pre-Invoice No." & preinvfrm.invfield(0)
.SelectionFormula = "{pre_invoice.preinv_id}='" & preinvfrm.invfield(0).Text & "'"
.action = 1
End With

?????????????
______________________________
- Regards Rohan (India,Mumbai)
 
Okay, try this:
before .action = 1, add this line:
.connect = "pwd=dbserver"

It should work if that is the password that was used in the Crystal report to connect. if this is not the password used there, it will not work.
 
hey man, but if i use rpt.connect = "pwd=password" before
action = 1 like you said, i think, won't show the correct data in the report! of course, because this line rpt.connect = "pwd=password", will be changing the original rpt connection string. sure man?

Ack,
Amauri Pimenta Junior
 
My Visual Basic 6.0 application has Oracle as database. I am using Crystal Report 8.0/8.5 . To run the report through VB I need DSN. But I want to run the report without using DSN. Is it possible. If yes, pl tell me on
manusinha@indtimes.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top