/    Sign up×
Community /Pin to ProfileBookmark

Whats wrong with this update statment

Im trying to figure out what is wrong with this update statment. Any ideas?

[CODE]<%
var Recordset1 = Server.CreateObject(“ADODB.Recordset”);
Recordset1.ActiveConnection = MM_MemphisAssessment_STRING;
Recordset1.Source = “SELECT * FROM [option] WHERE questionid = 725”;
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;

aroption = new Array();
arquestionid = new Array();

var f=new Enumerator(Request.Form);
var el;
var start;
var len;
var idx;

for (; !f.atEnd(); f.moveNext()) {
el = f.item().toString().toLowerCase();
start = el.indexOf(“_”);

if(start > -1) {
start++; len = el.length – start;
idx = parseInt(el.substr(start, len));

if(!isNaN(idx)) {
if(el.indexOf(“option”)!=-1) aroption[idx] = Request.Form(el);
if(el.indexOf(“questionid”)!=-1) arquestionid[idx] = Request.Form(el);
}
}
}

for(var i=0;i<arquestionid.length;i++) {
if(aroption[i] && arquestionid[i]) {
updateDB (aroption[i], arquestionid[i]);
}
else {
Response.Write(“”);
}
}

function updateDB(param_option, param_questionid) {
var update = Server.CreateObject(“ADODB.Command”);
update.ActiveConnection = MM_MemphisAssessment_STRING;
update.CommandText = “UPDATE option SET option = ‘” + param_option + “‘ WHERE questionID = ‘” + param_questionID + “‘”;
update.CommandType = 1;
update.CommandTimeout = 0;
update.Prepared = true;
update.Execute();
update.ActiveConnection.Close();
}

var Repeat1__numRows = -1;
var Repeat1__index = 0;
Recordset1_numRows += Repeat1__numRows;
%>[/CODE]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@landslideauthorJul 24.2007 — Any Ideas?
Copy linkTweet thisAlerts:
@landslideauthorJul 24.2007 — Anyone? I can figure it out
Copy linkTweet thisAlerts:
@DokJul 24.2007 — Your're asking in the wrong forum. Most people here know only JavaScript - not JScript/VBScript or whatever you are using - and since Javascript does not have any DB functions you will most likely not get a reply.
Copy linkTweet thisAlerts:
@landslideauthorJul 24.2007 — This was writen with Javascript.
×

Success!

Help @landslide spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...