By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,391 Members | 1,926 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,391 IT Pros & Developers. It's quick & easy.

Parameters Not writing to table

P: n/a

The following code does not execute properly. It only writes the first
array, and it does it all 23 times(the number of times it is suppose
to). All arrays are set (Dim studid(25)), calls to the database are
working correctly (it does write) etc. It just will not move from array
to array to write. The REQUEST.FORM commands are working properly as
well since I can print out the array (RESPONSE.WRITE) and everything
shows up correctly. Where are my mistakes?


for x = 1 to 23
studid(x) = Request.Form("T" & (x+125))
score(x) = Request.Form("T" & (x+79))
grade(x) = Request.Form("D" & (x+4))
notes(x) = Request.Form("T" & (x+102))

For x = 1 to 23

Set prm = cmd.CreateParameter("studid", adVarWChar, adParamInput, 20,
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("edate", adDBDate, adParamInput, ,
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("quarter", adVarWChar, adParamInput, 5,
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("subject", adVarWChar, adParamInput, 50,
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("entry", adVarWChar, adParamInput, 75,
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("score", adVarWChar, adParamInput, 10,
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("possible", adVarWChar, adParamInput, 10,
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("grade", adVarWChar, adParamInput, 10,
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("notes", adVarWChar, adParamInput, 150,
cmd.parameters.Append prm

cmd.Execute varRecords

If varRecords <> 0 Then
Response.Write "Record " & x & " updated."
Response.Write "Unable to update record " & x
End if


Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Oops----I forgot to mention that this is VBScript I am using since I
want to enter my grades on-line from home. The pages are all .ASP.


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.