没有为命令对象设置命令文本 - 在其他地方工作
Command text was not set for the command object - work in other places
由于某种我无法理解的原因,我收到了上述错误。我在 Connect() 断开连接后注释掉了,一切运行良好,所以我知道问题出在某个地方。我的代码是:
var sixMonth = parseInt(currentDate.getMonth() - 6);
sixMonth++;
var reviewDate = year + "-" + sixMonth + "-" + day;
var d1;
var d2 = new Date(reviewDate);
var intListViewIndex9 = 0;
Connect();
var EOF = 0;
RecordSet = new ActiveXObject("ADODB.Recordset");
//set the source
RecordSet.Source = statement;
//set the conection for the record set to use
RecordSet.ActiveConnection = ObjConnection;
//Open your RecordSet (i.e. Execute the query)
RecordSet.Open;
//declare the statement
statement = "SELECT AccessDate from screens.signoff WHERE BadgeNo = '" + BadgeNo + "'";
while (RecordSetas.EOF == false){
accessDate = RecordSet.Fields("AccessDate").Value;
d1 = new Date(accessDate);
if (d1.getTime() > d2.getTime()) {
SQL("UPDATE screens.signoff SET Recertify = '1' WHERE BadgeNo = '" + BadgeNo + "'");
}
//Move to the next record in the RecordSet
intListViewIndex9 = intListViewIndex9 + 1;
RecordSet.MoveNext;
}
//Close the RecordSet
RecordSet.Close;
//Destroy the objRecordSet object variable from memory
RecordSet = {};
disconect();
我在其他地方使用过这个结构,它工作得非常好,所以我不知道为什么不是这样。
这里是其他定义的位,它们被称为 SQL 的一部分。
var ObjConnection;
function Connect(){
ObjConnection = new ActiveXObject("ADODB.Connection");
SQLlook()
ObjConnection.Open ("DSN=SQL");
}
function disconect(){
//Close the Database Connection
ObjConnection.Close;
//Destroy the objConnection object variable from memory
ObjConnection = {};
}
ADyson 是对的,而不是设置 RecordSet.source = 语句然后声明它我只是在 (RecordSet.Source = "Select etc etc")[= 之后设置实际的 SQL 命令10=]
RescordSetas 也是一个错字
由于某种我无法理解的原因,我收到了上述错误。我在 Connect() 断开连接后注释掉了,一切运行良好,所以我知道问题出在某个地方。我的代码是:
var sixMonth = parseInt(currentDate.getMonth() - 6);
sixMonth++;
var reviewDate = year + "-" + sixMonth + "-" + day;
var d1;
var d2 = new Date(reviewDate);
var intListViewIndex9 = 0;
Connect();
var EOF = 0;
RecordSet = new ActiveXObject("ADODB.Recordset");
//set the source
RecordSet.Source = statement;
//set the conection for the record set to use
RecordSet.ActiveConnection = ObjConnection;
//Open your RecordSet (i.e. Execute the query)
RecordSet.Open;
//declare the statement
statement = "SELECT AccessDate from screens.signoff WHERE BadgeNo = '" + BadgeNo + "'";
while (RecordSetas.EOF == false){
accessDate = RecordSet.Fields("AccessDate").Value;
d1 = new Date(accessDate);
if (d1.getTime() > d2.getTime()) {
SQL("UPDATE screens.signoff SET Recertify = '1' WHERE BadgeNo = '" + BadgeNo + "'");
}
//Move to the next record in the RecordSet
intListViewIndex9 = intListViewIndex9 + 1;
RecordSet.MoveNext;
}
//Close the RecordSet
RecordSet.Close;
//Destroy the objRecordSet object variable from memory
RecordSet = {};
disconect();
我在其他地方使用过这个结构,它工作得非常好,所以我不知道为什么不是这样。
这里是其他定义的位,它们被称为 SQL 的一部分。
var ObjConnection;
function Connect(){
ObjConnection = new ActiveXObject("ADODB.Connection");
SQLlook()
ObjConnection.Open ("DSN=SQL");
}
function disconect(){
//Close the Database Connection
ObjConnection.Close;
//Destroy the objConnection object variable from memory
ObjConnection = {};
}
ADyson 是对的,而不是设置 RecordSet.source = 语句然后声明它我只是在 (RecordSet.Source = "Select etc etc")[= 之后设置实际的 SQL 命令10=]
RescordSetas 也是一个错字