delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

Unfortunately, when the command object arrives at SQL Server, it seems to say "Exec Get_Customer;1"
There's no sign of the input parameter value, and we can't figure out where the ";1" is coming from.
With the second parameter commented out, this routine works perfectly calling an MS Access stored procedure. But something seems to be keeping the input parameter from being passed properly to SQL Server.
Any ideas?


Here's my neat, clean call to a SQL Server stored procedure:
Code:
  1. <%
  2. Set Cmd = Server.CreateObject("ADODB.Command")
  3. With Cmd
  4.    .ActiveConnection = "Provider=sqloledb;" & _
  5.                        "Data Source=99.99.999.999;" & _
  6.                        "Initial Catalog=xxx;" & _
  7.                        "User ID=xxx;" & _
  8.                        "Password=xxxx"
  9.    .CommandText = "Get_Customer" ' name of stored procedure
  10.    .CommandType = adCmdStoredProc ' 4
  11.    .Parameters.Append .CreateParameter _
  12.             ("@PIN", adVarWChar, adParamInput, 13, "111 111-1234")
  13.    .Parameters.Append .CreateParameter _
  14.             ("@ErrorCode", adVarWChar, adParamReturnValue, 15)
  15.    Set Rs_Customer = Server.CreateObject("ADODB.Recordset")
  16.    On Error Resume Next
  17.    Set Rs_Customer = .Execute
  18. %>
Copy Code
Unfortunately, when the command object arrives at SQL Server, it seems to say "Exec Get_Customer;1"
There's no sign of the input parameter value, and we can't figure out where the ";1" is coming from.
With the second parameter commented out, this routine works perfectly calling an MS Access stored procedure. But something seems to be keeping the input parameter from being passed properly to SQL Server.
Any ideas?

TOP

I have just created a function with a stored procedure calling example here.  Try this example.
PHP Code:
<%
Function
ProcessProcedure
(
pin
)
Dim StoredProcResponse
    Dim rsGenRec
    Dim params
    StoredProcResponse
=
""
set rsGenRec
=
Server
.
CreateObject
(
"ADODB.Command"
)
rsGenRec
.
ActiveConnection
=
"Provider=sqloledb;"
&
_
"Data Source=99.99.999.999;"
&
_
"Initial Catalog=xxx;"
&
_
"User ID=xxx;"
&
_
"Password=xxxx"
rsGenRec
.
CommandText
=
"Get_Customer"
rsGenRec
.
CommandType
=
adCmdStoredProc
' Set up the arguments
    Set params = rsGenRec.CreateParameter ("@PIN", adVarChar, adParamInput, 13, pin)
    rsGenRec.Parameters.Append params
    Set params = rsGenRec.CreateParameter ("@ErrorCode", adVarChar, adParamOutput, , 0)
    rsGenRec.Parameters.Append params
    '
Execute the procedure
and
recover results
'Set rsORS = rsGenRec.Execute       '
Used
if
we need the returned record set
.
rsGenRec
.
Execute
    StoredProcResponse
=
rsGenRec
(
"@ErrorCode"
) '
The output parameter
    set rsGenRec=nothing
      ProcessProcedure = StoredProcResponse
end Function
%>



Unfortunately, when the command object arrives at SQL Server, it seems to say "Exec Get_Customer;1"
There's no sign of the input parameter value, and we can't figure out where the ";1" is coming from.
With the second parameter commented out, this routine works perfectly calling an MS Access stored procedure. But something seems to be keeping the input parameter from being passed properly to SQL Server.
Any ideas?

TOP

Back Forum