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 SkipVought 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

Status
Not open for further replies.

saramaia

Programmer
Aug 5, 2002
61
0
0
PT
Hi!

I have a VB form that calls a Crystal Report.
When i try to view the report, the folowing error occurs: "Cannot open SQL server".

Does anyone know why this happens?
 
hello every1,
I also have the same problem with saramaia.
This is my case:

I use crystal report 8. When i design my report,
i choose my database and tables using report expert connecting thru ODBC - MS Access Database.
I also have subreports in my report.
In every subreports and in my main report, I check the option Database - Verify on Every Print.
I also check the option File - Save Data with Report.

My Report works fine when i viewed it in Crystal Report Program.

Now, I called my report in VB.
This is how i Called it:
Crep1.ReportFileName = App.Path & "\reports\saleinvoice.rpt"
Crep1.WindowTitle = "Report " & Me.txtInvoiceNo
Crep1.SelectionFormula = "{saleinvoice.invoiceno}='" & Me.txtInvoiceNo & "'"
Crep1.WindowState = crptNormal
Crep1.SubreportToChange = "SalesList"
Crep1.SubreportToChange = "Additional"
Crep1.SubreportToChange = "Deductions"
Crep1.Action = 1

* crep1 is my crystal report control name

This code works fine except that it won't reflect newly added/edited fields/data.:(
I uncheck the option File-Save data with report and I get the error can't open sql server.

In my VB program, i connect to my database using odbc - ADO connection using the odbc data source administrator.
My connectionstring in my DSN is [ Provider=MSDASQL.1;Extended Properties="DSN=StarTrend;DBQ=C:\Star Trend Ware House\database\Trend.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;" ].

Can Pls anyone help me with this problem or give me sites i can read that can help me. This has been my problem for a week and I have been experimenting but to no success.

Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top