1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34:
| try if VarType(DBConnect) = varEmpty then if CoInitialize(NIL) = s_OK then DBConnect := CreateOLEObject('ADODB.Connection'); DBConnect.Open(DBConnectionString); except result := -1; end; if result = 0 then try pReq := TReadRequest(ReadRequest.Items[0]); try if pReq.sCommandline1 <> '' then case UpperCase(GetDataValue(pReq.sCommandline1,SEPARATOR,0))[1] of 'M' : MRecordSet := DBConnect.Execute(CreateSelectCommand(pReq.sCommandline1)); 'S' : SRecordSet := DBConnect.Execute(CreateSelectCommand(pReq.sCommandline1)); end; if pReq.sCommandline2 <> '' then case UpperCase(GetDataValue(pReq.sCommandline2,SEPARATOR,0))[1] of 'M' : MRecordSet := DBConnect.Execute(CreateSelectCommand(pReq.sCommandline2)); 'S' : SRecordSet := DBConnect.Execute(CreateSelectCommand(pReq.sCommandline2)); end; except ErrStr := ErrStr+DBConnect.Errors[DBConnect.Errors.Count-1].Description+SEPARATOR; end; Ergebnis := TStringList.create; try if VarType(MRecordSet) <> varEmpty then if MRecordSet.RecordCount > 0 then begin Ergebnis.Add(MRecordSet.GetString(StringClipString,-1,SEPARATOR,LineBreaker)); end; if VarType(SRecordSet) <> varEmpty then if SRecordSet.RecordCount > 0 then begin Ergebnis.Add(SRecordSet.GetString(StringClipString,-1,SEPARATOR,LineBreaker)); end; |