Subject Re: COUNT field incorrect Error
Author jskeeve
As far as have I tried the having done the response.write trick to
see if there is a problem with the sql. I have. That's how I got the
SQL string to post up here. I will however try the CStr to see if
that helps any. I guess I will post this message in an ASP group.

--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
> >
> > connection.execute "EXECUTE Procedure SP_WEB_UPDATEACCOUNT(" &
session
> > ("AID") & ",'" & FName & _
> > "','" & LName & "','" & Addr1 & "','" & addr2 & "','" & City
& "','"
> > & State & _
> > "','" & Zip & "');"
> >
> That error has nothing to do with Firebird - it's ASP related..
>
> Have you tested that a value actually exists for session("AID") by
echoing
> to output?
> Have you tested the entire statement by assigning the statement to a
> variable and echoing it to the page?
> e.g.
> myvar = "EXECUTE Procedure SP_WEB_UPDATEACCOUNT(" & session("AID")
& ",'" &
> FName & "','" & LName & "','" & Addr1 & "','" & addr2 & "','" &
City & "','"
> & State & "','" & Zip & "');"
> Response.Write myvar
>
> You need to try this form of syntax (i.e. use brackets as well and
the CStr
> function for integers)
> connection.execute("EXECUTE Procedure SP_WEB_UPDATEACCOUNT("
> CStr(session("AID"))+ ",'" & FName & "','" & LName & "','" & Addr1
& "','" &
> addr2 & "','" & City & "','" & State & "','" & Zip & "')")
>
> And you could also use parameters as in this method which is by far
the most
> reliable:
> Set cmd = Server.CreateObject("ADODB.Command")
> Set cmd.ActiveConnection = DBConn
> cmd.CommandText = "SP_WEB_UPDATEACCOUNT"
> cmd.CommandType = adCmdStoredProc
> cmd.Parameters.Append cmd.CreateParameter( "AID", adInteger,
adParamInput )
> cmd.Parameters("RVALUE") = CLng(Session("AID"))
> cmd.Parameters.Append cmd.CreateParameter( "FNAME",
adVarChar, adParamInput
> 30)
> cmd.Parameters("FNAME") = (Request.Form("fname"))
>
> etc
>
> cmd.Execute ,, adCmdStoredProc + adExecuteNoRecords
>
> Alan