问题描述
将旧的asp文件转换为aspx之后,ADODB记录集不再返回数据.这是一个示例:
函数getXtype(sConn,sName){
var sSql,sDoc,oRs;
sSql ="Select * From sysobjects where name ='" + sName +'";
oRs = new ActiveXObject("ADODB.Recordset");
oRs.Open(sSql,sConn,1,3,1); //adOpenKeyset,adLockOptimistic,adCmdText
if(!oRs.EOF){
sDoc = oRs("xtype");
} else {
}
return sDoc;
}
该查询已成功执行,并返回一个记录集,但"oRs("xtype")返回一个名为ADODB.InternalFields的字符串数据``S''的对象.
用于测试的参数可能是: driver = {sql server}; AnsiNPW = No; uid = sa; pwd = ***;
sName =" sysobjects;
如何获取ADODB以返回正确的数据?
After converting old asp files to aspx ADODB recordet does not return data any more. Here is a sample:
function getXtype(sConn, sName){
var sSql, sDoc, oRs;
sSql= "Select * From sysobjects Where name = '" + sName + "'";
oRs= new ActiveXObject("ADODB.Recordset");
oRs.Open(sSql, sConn, 1, 3, 1); // adOpenKeyset, adLockOptimistic, adCmdText
if(!oRs.EOF){
sDoc = oRs("xtype");
}else{
sDoc = "";
}
return sDoc;
}
The query is executed ok and returns a recordset but " oRs("xtype") " returns a object called ADODB.InternalFields insted of the string data "S".
Parameters for test may be:
sConn = "SERVER=(local);DATABASE=nbx;Provider=MSDASQL;driver={sql server};AnsiNPW=No;uid=sa;pwd=***";
sName = "sysobjects";
How do i get ADODB to return the correct data?
推荐答案
感谢您的帖子!我建议将您的问题发布到首页›
Thank you for your post! I would suggest posting your question in one of the Home ›
这篇关于jscript aspx和ADODB.InternalFields的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!