如何取得db里面的值
function OnBegin()
STRING szADOCommObjID, szADOObjID, szConnSting;
OBJECT pADOObj, pADOCommObj,obj;
begin
szADOObjID = "ADODB.Connection";
set pADOObj = CreateObject(szADOObjID);
// Create the SQL string to complete the connection
szConnSting = "driver={SQL Server};";
szConnSting = szConnSting + "server=192.168.131.65;";
szConnSting = szConnSting + "uid=sa;";
szConnSting = szConnSting + "pwd=sony;";
szConnSting = szConnSting + "database=ELCDB";
// Open the ADO Connection
pADOObj.Open(szConnSting);
// Create the ADO Command object to execute the script
szADOCommObjID = "ADODB.Command";
set pADOCommObj = CreateObject(szADOCommObjID);
pADOCommObj.ActiveConnection = pADOObj;
pADOCommObj.CommandText = "select HostName,Comment from host";
set obj = pADOCommObj.Execute();
while (!obj.EOF)
MessageBox(obj("HostName"),WARNING);
obj.movenext;
endwhile;
end;