Zitat von
mkinzler:
Poste mal die datenbankbeschreibung und die Abfrage.
Es handelt sich um eine Datenbank der Softwareverteilung. Ich brauche den Zugriff immer nur LESEND.
Hier die Filterung welche den Fehler hervorruft:
Delphi-Quellcode:
procedure TForm1.CheckBox1Click(Sender: TObject);
var
strint:string;
s: string;
begin
query1.filtered:=false;
if edit1.text<>'' then
begin
s:=chr(39);
if checkbox1.checked=true then
begin
if checkbox2.checked=true then
begin
strint:=edit1.text;
query1.filter:='oname = ' + s + strint +s;
query1.filtered:=true;
end else
begin
strint:=edit1.text;
query1.filter:='oname like ' + s + strint +'%'+s;
query1.filtered:=true;
end;
end else
begin
query1.filtered:=false;
end;
end;
end;
Der
SQL String der SQLQuery siehst so aus:
SQL-Code:
SELECT COOBJECTS.ONAME, COPROPITEMS.PINAME, COOBJECTS.OINACTIVE, COPROPVALUES.PVNAME, COOBJECTS.OFULLNAME, COOBJECTS.OEMAIL, COOBJECTS.OCOSTCENTER, COOBJECTS.OTYPE AS Kurz
FROM ((COPROPDATA INNER JOIN COOBJECTS ON COPROPDATA.OID = COOBJECTS.OID) INNER JOIN COPROPITEMS ON COPROPDATA.PIID = COPROPITEMS.PIID) INNER JOIN COPROPVALUES ON COPROPDATA.PVID = COPROPVALUES.PVID
WHERE (((COPROPITEMS.PINAME)='Components.Last User') AND ((COOBJECTS.OINACTIVE)='0') AND ((COOBJECTS.OTYPE)='M')) OR (((COPROPITEMS.PINAME)='Components.System.Manufacturer') AND ((COOBJECTS.OINACTIVE)='0')) OR (((COPROPITEMS.PINAME)='Components.System.Computer Model') AND ((COOBJECTS.OINACTIVE)='0')) OR (((COPROPITEMS.PINAME)='Components.System.Motherboard.SerialNumber') AND ((COOBJECTS.OINACTIVE)='0')) OR (((COPROPITEMS.PINAME)='Components.System.Processor.MaxSpeed') AND ((COOBJECTS.OINACTIVE)='0')) OR (((COPROPITEMS.PINAME)='Components.Storage.Memory.Total') AND ((COOBJECTS.OINACTIVE)='0')) OR (((COPROPITEMS.PINAME)='Components.Harddisk.TotalSize') AND ((COOBJECTS.OINACTIVE)='0'))
ORDER BY COOBJECTS.ONAME;