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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 problem using a stoed procedure

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-01-19 : 03:01:18
i have 2 DB
and i have a USER that defined as a db_owner of both of the DB's.
when i try to activate a SP on the second Db like this :

set cm_delOrder = Server.CreateObject("ADODB.Command")
cm_delOrder.ActiveConnection = Application("ConnStr")
cm_delOrder.CommandType = adcmdstoredproc
cm_delOrder.CommandText = "DB2.dbo.sp_DeleteOrder"
response.write request("id") ' isee that i do have a value in "id"
cm_delOrder.Parameters("@ID") = cint(request("id"))
cm_delOrder.Execute

when i activate this SP with an id from the query analzyzer everything works great!
when i do the same in asp(with the above code) i get the errorr :
quote:
ADODB.Command error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.
orders.asp, line 10



what can be the reason?
thnaks in advance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-01-19 : 08:15:47
I think u need to have seperate connection strings for the 2 DBs.
(Ur Connection is for one DB and u r using another DB)
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-01-26 : 00:56:21
bjut the user defined in the connection string his defined for both DB's

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-01-26 : 08:06:21
Nothing to do with the user here
In ASP or VB where u connect to the DBs, u should have 2 connection
ConnStr -->
ConnStr1 to connect to one DB
ConnStr2 to connect to the other DB
Go to Top of Page
   

- Advertisement -