Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Calling a synonym from ASP classic

Author  Topic 

jammus
Starting Member

6 Posts

Posted - 2008-02-28 : 06:43:42
Hello all,

I'm trying to bring a couple of databases into line so I can use the same code to access them both. This has required me to rewrite a couple of stored procedures. In order to make it obvious when there are two versions I've appended the names of the new procedures with '_new'. In order to prevent me from having to change the asp code to call these stored procedures I've created some synonyms. All went well and I was feeling pretty pleased with myself until I went to try it out :)

Calling a synonym for a stored procedure in asp is giving me this error:

The request for procedure 'usp_contact_GetContactsSearchedPagedAndSorted' failed because 'usp_contact_GetContactsSearchedPagedAndSorted' is a synonym object.

Here's the ASP code:

selectQuery = "EXEC usp_contact_GetContactsSearchedPagedAndSorted"

Set RS_getFullRS = Server.CreateObject("ADODB.Recordset")
RS_getFullRS.ActiveConnection = MM_Connection_STRING
RS_getFullRS.Source = selectQuery
RS_getFullRS.CursorType = 1
RS_getFullRS.CursorLocation = 2
RS_getFullRS.LockType = 3
RS_getFullRS.Open()

arrTempRS = RS_getFullRS.GetRows

Does anyone have any ideas? Google seems reluctant to help me out but maybe I'm looking in the wrong place.

Cheers

edit: if I execute the sql above from within Server Management Studio it works just fine
   

- Advertisement -