def getRecordSet(conStr, sql, sysInfo):
localDb = ""
oDB = clsAdo()
if (conStr.find("config") <> -1):
localDb = sysInfo.configDbLocal
elif (conStr.find("spd") <> -1):
localDb = sysInfo.spdDbLocal
if (localDb <> ""):
if ( oDB.connect(localDb) == False ):
displayErrorMsg("getRecordSet", "smt_utility.py", "Could not connect to the Database.", 1)
oRS = oDB.getResultSet(sql)[0]
if (oRS.EOF):
oDB.Disconnect()
if ( oDB.Connect(conStr) == False ):
displayErrorMsg("getRecordSet", "smt_utility.py", "Could not connect to the Database.", 1)
oRS = oDB.getResultSet(sql)[0]
else:
if ( oDB.connect(conStr) == False ):
displayErrorMsg("getRecordSet", "smt_utility.py", "Could not connect to the Database.", 1)
oRS = oDB.getResultSet( sql )
oDB.disconnect()
del oDB
return oRS
|