Subject | RE: [firebird-support] Re: Question about: SQL error code = -804 Incorrect values within SQLDA structure |
---|---|
Author | Alan McDonald |
Post date | 2005-02-02T10:21:29Z |
> > show us the ASP code. I use SPs in ASP all the time with no errors.this is a typical code set from something which works:
> > Alan
>
> Here is the asp code:
>
> 'create the stored produre command
> Set cmd = Server.CreateObject("ADODB.Command")
> Set cmd.ActiveConnection = conn
>
> cmd.CommandText = lProcedureName
> cmd.CommandType = adCmdStoredProc
>
> cmd.Parameters.Refresh
>
> 'set the stored procedure parameters
> for lCount = 0 to UBound(arrColumnnames)
> if arrProcedureNames(lCount) = lProcedureName and not trim
> (lProcedureName) = "" then
>
> 'create command parameters
> cmd.Parameters(arrColumnNames(lCount)).Value = arrValues(lCount)
> end if
> next
>
> set rs = cmd.execute
>
> ' end of code
>
>
> There are no problems when I set the values for the parameters, I
> only get the message when I execute the cmd. Maybe it is something
> small and I just dont see it. Like I said, i have checked all of the
> types and as far as I can tell, they all correspond to the types in
> the database.
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = DBConn
cmd.CommandText = "newmember"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter( "FNAME", adVarChar,
adParamInput, 50 )
cmd.Parameters("FNAME") = MID(Request.Form("firstname"),1,50)
cmd.Parameters.Append cmd.CreateParameter( "LNAME", adVarChar,
adParamInput, 50 )
cmd.Parameters("LNAME") = MID(Request.Form("lastname"),1,50)
cmd.Parameters.Append cmd.CreateParameter( "TITLE", adVarChar,
adParamInput, 5 )
cmd.Parameters("TITLE") = MID(Request.Form("title"),1,50)
<snip>
cmd.Execute ,, adCmdStoredProc + adExecuteNoRecords
Note: the parameters are typed.
if you do not have adovbs.inc in view then you will need to set the the
constants manually.
If the SP returns a result set which appears to be the case, then you need
to treat this as a parametised query, not an SP
Alan