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
Hello,

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?

worldbadger

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))
Next

For x = 1 to 23

Set prm = cmd.CreateParameter("studid", adVarWChar, adParamInput, 20,
Z2Null(studid(x)))
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("edate", adDBDate, adParamInput, ,
Z2Null(Request.Form("date")))
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("quarter", adVarWChar, adParamInput, 5,
Z2Null(Request.Form("quarter")))
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("subject", adVarWChar, adParamInput, 50,
Z2Null(Request.Form("subject")))
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("entry", adVarWChar, adParamInput, 75,
Z2Null(Request.Form("assign")))
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("score", adVarWChar, adParamInput, 10,
Z2Null(score(x)))
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("possible", adVarWChar, adParamInput, 10,
Z2Null(Request.Form("poss_score")))
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("grade", adVarWChar, adParamInput, 10,
Z2Null(grade(x)))
cmd.parameters.Append prm
Set prm = cmd.CreateParameter("notes", adVarWChar, adParamInput, 150,
Z2Null(notes(x)))
cmd.parameters.Append prm

cmd.Execute varRecords

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

Next

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.

worldbadger

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.