p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Databases (http://p2p.wrox.com/forumdisplay.php?f=62)
-   -   Executing a stored procedure from ASP (http://p2p.wrox.com/showthread.php?t=8519)

tlbacon527 January 23rd, 2004 02:52 PM

Executing a stored procedure from ASP
  I have been wrestling with this issue for two days and am quite unsure of where to go from here.
Here is a sample of my non-working code
            Dim spConn
            Dim spComm
            set spConn = Server.CreateObject("ADODB.Connection")
            set spComm = Server.CreateObject("ADODB.Command")
            spConn.Open "Provider=SQLOLEDB.1; Data Source=xxxgnvsql; Initial Catalog=QARepositoryTest; User Id=user1; Password=password"

            spComm.ActiveConnection = spConn
            spComm.CommandType = 4
            spComm.CommandText = "GetWorkOrder"
            spComm.Parameters.Append spComm.CreateParameter
               ("workorderid", adInteger, adParamInput, 4, 5347)

I receive the following error

ADODB.Command error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/practice/connect.asp, line 13
It is associated to the Parameter object being created. I set commandtype to 4 as I read it in one of books else I get an error for that if I set it equal to adCmdStorProc. Does anyone have any suggestions of something that I am just not seeing? Any help is greatly appreciated.


shahchi1 January 23rd, 2004 03:43 PM

(a) put <% Option Explicit %> at the top of your code
(b) In case if you have not included, include ADO Type library or ADOVBS.inc at the top of your page.

<!-- METADATA TYPE="typelib"
     NAME="ADO 2.5 Type Library"

Chirag Shah

tlbacon527 January 23rd, 2004 03:50 PM

Thank you very much! That was exactly what it needed.


All times are GMT -4. The time now is 05:17 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.