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 IamaSherpa 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 :(

Status
Not open for further replies.

Fursten

Programmer
Dec 27, 2000
403
PT
Hi,

I´m using Crystal Reports 8.0 OCX in my VB 6.0 application.
I have this code:

CrystalReport1.Connect = GBL_connString
CrystalReport1.ReportFileName= "S:\AdmProp\Nova_Aplic\Reports\Orcam2.rpt"
CrystalReport1.WindowShowGroupTree = False
CrystalReport1.WindowState = crptMaximized
CrystalReport1.WindowMaxButton = True
CrystalReport1.WindowControlBox = False
CrystalReport1.WindowShowCloseBtn = True
CrystalReport1.Formulas(0) = ("Ano= '" & a & "'")

CrystalReport1.Destination = crptToWindow
CrystalReport1.Action = 1

I´m trying to get the report into the screen, however, I get this error message: "cannot open Sql Server"

Note: GBL_connString = "Provider = sqloledb.1;Data Source = saglobaladp01;Initial catalog = AdmProp;user id = admprop;password = admpropprod" --> and this connection is working fine!

So, it seems that I´m doing something wrong... I thought that I should use the "connect" property but it seems not to work :(

Any help is appreciate.

Thank you

Sergio Oliveira


 
The .Connect property is correct. Pass it parameters that Crystal is looking for, not VB/OBDC. Here's the example from the Crystal help files:

CrystalReport1.Connect = DSN = Accounting;UID = 734;PWD = bigboard;DSQ = Administration

«Connects to the Administration database on the Accounting server using the user ID #734 and the password bigboard.»
 
Hi,

The problem is that I´m not using ODBC but OLEDB. In the Object Browser I can see that the "connect" property is only for ODBC connection... (it says: "an ODBC connect string) so I think that this will not help me :( I´m not using DSN so.

Sergio Oliveira

 
Hi again,

I had solved the problem: you were right. I was a connection string for OLEDB having in mind that Crystal like other names to the parameters and it works.

Thank you

Sergio Oliveira
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top