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

changing stored procedure name

Status
Not open for further replies.

ref

Programmer
May 3, 2001
4
US
I have a report that uses a stored procedure called sp_sample_one.
The report was created with the reference to this stored procedure

In the asp page I make references
crtable.SetLogonInfo "TestDB", "TestDB", cstr(userid), cstr(password)
crtable.Location = Cstr("sp_sample_one")
works fine

now I made an exact copy of sp_sample_one and called it sp_sample_two
In the asp page I did ....
crtable.SetLogonInfo "TestDB", "TestDB", cstr(userid), cstr(password)
crtable.Location = Cstr("sp_sample_two")
but I get the following error in the smartviewer
Error Occurred Reading Records: Error detected by database DLL

The only thing that changed is the reference to the stored procedure name

Thanks
 
If I understand correctly, you created the report using the stored procedure fields from sp_sample_one. When you try to open the report and send it sp_sample_two, crystal is looking for fields like {sp_sample_one.field_name}. The only solution I've found for using the same report with more than one stored procedure is to have two copies of the report. One you open for sp_sample_one, the other you open for sp_sample_two.

The only bad thing is that copy two of the report needs to be altered by adding sp_sample_two to the report, and inserting all the fields you need, then deleting all fields referring to sp_sample_one. Then you need to remove sp_sample_one query altogether.
 
If you are in the report designer, you can point to a different SP by using the menu commands:

Database - Set Location.

However, there should also be a way to change the SP from the app. However, I am afraid I don't know the ASP syntax for this. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top