Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: PAssing parameters to a Sybase Stored Proc


Message #1 by stewart_noble@h... on Mon, 17 Sep 2001 18:33:03
Hi,



I don't know if anyone can help, but I am having a rather odd problem.  I 

am using a Sybase (11) database and am able to connect ok and execute a 

stored procedure in the database, but when I try to pass a parameter to 

the procedure I get the following error :



Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

[INTERSOLV][ODBC SQL Server driver][SQL Server]Procedure sn_test1 expects 

parameter @name, which was not supplied. 



If I don't try and pass the parameter, I get a "procedure expects the 

following parameter(@name) error"



The code I am using is as follows:



<%@ Language=VBScript %>

<%



gsConnect = "Driver={Sybase System 

11};SRVR=ISSERVER;UID=DB_USER2;PWD=intershop;"



Set Conn = server.createobject("ADODB.Connection")



Conn.open gsConnect



Set RS = server.CreateObject("ADODB.recordset")



Set CmdCommand = server.CreateObject("ADODB.command")

With CmdCommand

	.ActiveConnection = Conn

	.CommandType = 4 

	.CommandText = "sn_test1"

'	.Parameters("@name") = "hello"

	Set RS = .Execute

end with



if not RS.EOF then

	while not rs.eof

		Response.Write("<br>Position : " & rs.fields("Name1"))

		rs.MoveNext

	wend

else

	Response.Write(gsConnect)

	Response.Write("<br>Oh No")

end if

 

Conn.Close

Set Conn = Nothing

%>

 



Would be grateful for any advice

thanks



Stewart

  Return to Index