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

Accessing SQL Database w/Stored Procedure and Parameters

Status
Not open for further replies.
Jan 3, 2001
66
US
I have several Crystal Reports that I want to produce through VB 6.0 and SQL Server 2000. I have developed these reports outside of VB and want to integrate them at this time. I have used the RDC with a DSR method. And then I used the following line of code to connect to the data base:

crInvoices.Database.LogOnServer "P2SSql.DLL", "srvername", "DataBase", "UserID", "password"

Of course with the proper values for my database.

The report prompts for the required parameters. I enter them and then the whole process chokes and VB closes.

This report works just fine from within the Crystal envirnoment.

Help!
 
Are you using native drivers for the database connection?

In general, I noticed that native drivers do not work as well as ODBC does. Try changing it to ODBC and see if you get the same error.
 
I worked with this situation for quite some time. I successfully tried to get a very simple report to work with the same code. But the invoices that I wanted to print were quite complex. I started by eliminating one of the subreports and then adding it back in later. That seemed to be the answer.

Trial and error is the name of this game.

Carolyn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top