jasmeenkaur27
7 years agoContributor
Getting unspecified error
Hi,
I created the below function and got an error :
Provider
Unspecified Error
Error occurs at the highlighted line.
function fn_getDBData(strConnectionString, strQuery)
{
var objCon, objRS, strData;
strData = "";
objCon = Sys.OleObject("ADODB.Connection");
objCon.Open(strConnectionString);
if(objCon.State==1)
{
objRS = Sys.OleObject("ADODB.RecordSet");
Log.Message("Executing Query: "+strQuery);
objRS.Open(strQuery,objCon,3);
while(!objRS.EOF)
{
for(i=0;i<objRS.Fields.Count;i++)
{
strData = strData + objRS.Fields.Item(i).Name + "=" + objRS.Fields.Item(i).Value + ";;"
}
strData = strData.substr(0,strData.length-2);
strData = strData + "||"
objRS.MoveNext();
}
strData = strData.substr(0,strData.length-2);
}
objRS.Close();
objCon.Close();
return strData;
}