to execute my first stored procedure. I created the stored procedure
and verified that it works, but when I try to execute it from Access:
cnn.Execute("sp_IPT")
it says: 'Could not find stored procedure 'sp_IPT'
Any ideas?
Norman B. Scheinin
F-22 Applications Development
M/S 4E-09
(206) 655-7236
norman.b.scheinin@.boeing.comNorman Scheinin (norman.b.scheinin@.boeing.com) writes:
> I have an Access 2000 database connected to a SQL Server and am trying
> to execute my first stored procedure. I created the stored procedure
> and verified that it works, but when I try to execute it from Access:
> cnn.Execute("sp_IPT")
> it says: 'Could not find stored procedure 'sp_IPT'
> Any ideas?
I would guess that you have not specified which database to work in.
You define this with "Initial Catalog" in the connection string. You
can also have a default database set for your SQL login. You can also
specify a three-part name when you invoke the procedure:
cnn.Execute("yourdb..sp_IPT")
I would also like to take the occassion to discourage you from using
sp_ as the first letters in the names of your stored procedures. This
prefix is reserved for system procedures, and SQL Server first looks
in the master database for these. It then looks in your current database,
so the prefix is not the cause for your problem.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
No comments:
Post a Comment