mcrmg
asked on
ASP Parameter to MS Access
Hi,
I am using ASP as frontend to send parameters to Access queries.
If I send iAgingi and iAgingj alone OR iFICO alone, it works fine. However, if I put all 3 together, it alwasys retuen 0 records. But if I run the query in Aceess, it is fine. Any ideas? Thanks
Set pm = oCmd.CreateParameter("iAgi ngi", adInteger, adParamInput, , iAgingi)
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("Agin gj", adInteger, adParamInput, , iAgingj)
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("iFIC O", adInteger, adParamInput, , iFICO)
oCmd.Parameters.Append pm
I am using ASP as frontend to send parameters to Access queries.
If I send iAgingi and iAgingj alone OR iFICO alone, it works fine. However, if I put all 3 together, it alwasys retuen 0 records. But if I run the query in Aceess, it is fine. Any ideas? Thanks
Set pm = oCmd.CreateParameter("iAgi
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("Agin
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("iFIC
oCmd.Parameters.Append pm
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I use the following, and the error msg.
With oCmd
.Parameters.Append.CreateP arameter "Deal", adInteger, adParamInput,50, sDeal
.Parameters.Append.CreateP arameter "iAgingi", adInteger, adParamInput,0, iAgingi
.Parameters.Append.CreateP arameter "Agingj", adInteger, adParamInput,0, iAgingj
.Parameters.Append.CreateP arameter "iFICO", adInteger, adParamInput,0, iFICO
.Execute
End With
oRs.Open oCmd,,-1
Wrong number of arguments or invalid property assignment: 'Parameters.Append'
With oCmd
.Parameters.Append.CreateP
.Parameters.Append.CreateP
.Parameters.Append.CreateP
.Parameters.Append.CreateP
.Execute
End With
oRs.Open oCmd,,-1
Wrong number of arguments or invalid property assignment: 'Parameters.Append'
Try..
Set oCmd=Server.CreateObject(" ADODB.COMM AND")
With oCmd
.Parameters.Append.CreateP arameter "Deal", adInteger, adParamInput,50, sDeal
.Parameters.Append.CreateP arameter "iAgingi", adInteger, adParamInput,50, iAgingi
.Parameters.Append.CreateP arameter "Agingj", adInteger, adParamInput,50, iAgingj
.Parameters.Append.CreateP arameter "iFICO", adInteger, adParamInput,50, iFICO
End With
oRs.Open oCmd,objConn,1,3
I assume that you have included the adovbs.inc file..
Cheers!!
Set oCmd=Server.CreateObject("
With oCmd
.Parameters.Append.CreateP
.Parameters.Append.CreateP
.Parameters.Append.CreateP
.Parameters.Append.CreateP
End With
oRs.Open oCmd,objConn,1,3
I assume that you have included the adovbs.inc file..
Cheers!!
ASKER
I am still getting this error.
Wrong number of arguments or invalid property assignment: 'Parameters.Append'
if I use this separately, it works fine. That bothers me. Thans,.
Set pm = oCmd.CreateParameter("iAgi ngi", adInteger, adParamInput, , iAgingi)
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("Agin gj", adInteger, adParamInput, , iAgingj)
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("iFIC O", adInteger, adParamInput, , iFICO)
oCmd.Parameters.Append pm
Wrong number of arguments or invalid property assignment: 'Parameters.Append'
if I use this separately, it works fine. That bothers me. Thans,.
Set pm = oCmd.CreateParameter("iAgi
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("Agin
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("iFIC
oCmd.Parameters.Append pm
ASKER
I think that's something with this
Set pm = oCmd.CreateParameter("iAgi ngi", adInteger, adParamInput, , iAgingi)
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("Agin gj", adInteger, adParamInput, , iAgingj)
oCmd.Parameters.Append pm
because I have about 6 or 7 parameters, when I combine them except these two, it works fine. Once I add them in, it returns me 0 reacords.
Set pm = oCmd.CreateParameter("iAgi
oCmd.Parameters.Append pm
Set pm = oCmd.CreateParameter("Agin
oCmd.Parameters.Append pm
because I have about 6 or 7 parameters, when I combine them except these two, it works fine. Once I add them in, it returns me 0 reacords.
Are you sure that iAgingi & iAgingj return valid values?
Do a response.write on these two variables and see what they return... also, make sure that the name of the Input parameters for the sp are iAgingi & iAgingj respectively.
Cheers!!
Do a response.write on these two variables and see what they return... also, make sure that the name of the Input parameters for the sp are iAgingi & iAgingj respectively.
Cheers!!
Could you post the rest of the code so that i could check what the problem could be..
Cheers!!
Cheers!!
ASKER
I forgot the order of the parameters that send to the sp.
:)
Thanks 4 the help
:)
Thanks 4 the help
Glad you solved the problem.. Thanks for the points...
Cheers!!
Cheers!!
With oCMD
.activeconnection="connect
.commandText="StoredProced
.CommandType = acCmdStoredProc
.Parameters.Append.CreateP
.Parameters.Append.CreateP
.Parameters.Append.CreateP
.Execute
End With
Cheers!!