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!

Executing a Report from VB based on SQL stored proc 1

Status
Not open for further replies.

RangerFan

MIS
May 4, 2000
61
US
I am attempting to run a Crystal report from a VB (6.0) app
that is based on a SQL 7 stored procedure. Everything works
fine on my pc, but when I distribute the app I get a message
that SQL Server can't be opened when I click on the menu item that runs the report.

The pc where the distributed app resides does have access to the SQL 7 database where the stored procedure resides.

The VB app uses the Crystal control and the code used to
invoke the report is as follows:

Private Sub mnuCal_Click()
Report2.Action = 1
End Sub

When this code is executed, the Crystal environment is then
displayed, followed by the error message.

Perhaps I need more code to make the connection to SQL 7, but then why does everything work OK on my development pc?

Any help would be appreciated.
 
First thing to remember: Everything always works in your local environment...

Second: You need to be sure the ODBC connection in the machine you are trying to run these reports on is set up correctly.

Third (this one gives the report a bit more flexibility): When you set the location of the database for a report it looks something like this -

'MyDatabase.dbo.Proc(MyStoredProc;1)'

This tells the report to ONLY use the database if it is called MyDatabase, and likewise the SP. If you remonve all the hard coded location junk, and just put the name of the stored procedure or table there, the report will more likely do what you want...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top