Link to home
Start Free TrialLog in
Avatar of mcrmg
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("iAgingi", adInteger, adParamInput, , iAgingi)
oCmd.Parameters.Append pm

Set pm = oCmd.CreateParameter("Agingj", adInteger, adParamInput, , iAgingj)
oCmd.Parameters.Append pm

Set pm = oCmd.CreateParameter("iFICO", adInteger, adParamInput, , iFICO)
oCmd.Parameters.Append pm
Avatar of ap_sajith
ap_sajith

Try..

With oCMD
.activeconnection="connectionstring/object"
.commandText="StoredProcedure"
.CommandType = acCmdStoredProc
.Parameters.Append.CreateParameter("iAgingi", adInteger, adParamInput, , iAgingi)
.Parameters.Append.CreateParameter("Agingj", adInteger, adParamInput, , iAgingj)
.Parameters.Append.CreateParameter("iFICO", adInteger, adParamInput, , iFICO)
.Execute
End With

Cheers!!
SOLUTION
Avatar of ap_sajith
ap_sajith

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mcrmg

ASKER

I use the following, and the error msg.  



With oCmd
.Parameters.Append.CreateParameter "Deal", adInteger, adParamInput,50, sDeal
.Parameters.Append.CreateParameter "iAgingi", adInteger, adParamInput,0, iAgingi
.Parameters.Append.CreateParameter "Agingj", adInteger, adParamInput,0, iAgingj
.Parameters.Append.CreateParameter "iFICO", adInteger, adParamInput,0, iFICO
.Execute
End With

oRs.Open oCmd,,-1

Wrong number of arguments or invalid property assignment: 'Parameters.Append'
Try..

Set oCmd=Server.CreateObject("ADODB.COMMAND")
With oCmd
.Parameters.Append.CreateParameter "Deal", adInteger, adParamInput,50, sDeal
.Parameters.Append.CreateParameter "iAgingi", adInteger, adParamInput,50, iAgingi
.Parameters.Append.CreateParameter "Agingj", adInteger, adParamInput,50, iAgingj
.Parameters.Append.CreateParameter "iFICO", adInteger, adParamInput,50, iFICO
End With

oRs.Open oCmd,objConn,1,3

I assume that you have included the adovbs.inc file..

Cheers!!
Avatar of mcrmg

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("iAgingi", adInteger, adParamInput, , iAgingi)
oCmd.Parameters.Append pm

Set pm = oCmd.CreateParameter("Agingj", adInteger, adParamInput, , iAgingj)
oCmd.Parameters.Append pm

Set pm = oCmd.CreateParameter("iFICO", adInteger, adParamInput, , iFICO)
oCmd.Parameters.Append pm
Avatar of mcrmg

ASKER

I think that's something with this

Set pm = oCmd.CreateParameter("iAgingi", adInteger, adParamInput, , iAgingi)
oCmd.Parameters.Append pm

Set pm = oCmd.CreateParameter("Agingj", 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.
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!!
Could you post the rest of the code so that i could check what the problem could be..

Cheers!!
Avatar of mcrmg

ASKER

I forgot the order of the parameters that send to the sp.

:)


Thanks 4 the help
Glad you solved the problem.. Thanks for the points...

Cheers!!