Thema: Delphi SQL problem

Einzelnen Beitrag anzeigen

nanix
(Gast)

n/a Beiträge
 
#9

Re: SQL problem

  Alt 7. Dez 2009, 14:34
Are you sure it will work?

[quote]First chance exception at $75B6B727. Exception class EABSException with message 'Token '=' expected, but 'Min' found at line 1, column 39 - Native error: 30221'. Process Project1.exe (4708)[/quote

Delphi-Quellcode:
end //Creating Stoped
else begin //We start update
ABSQuery1.SQL.Clear;
ABSQuery1.SQL.Text := 'UPDATE Sensors SET Field="' +sField+'"' +','+'Value="'+sValue+'"'+',' +','+'Min="'+sMin+'"'+',' +','+'Max="'+sMax+'"'+' WHERE hwm_id = :HWM_ID and sensor_class = :Sensor_Class and sensor_id = :Sensor_ID';






for hwm_index := 0 to NBMonitors - 1 do

for sensor_index := 0 to CPUIDSDK_GetNumberOfSensors(hwm_index, SENSOR_CLASS_VOLTAGE) - 1 do begin
if CPUIDSDK_GetSensorInfos(hwm_index,
sensor_index,
SENSOR_CLASS_VOLTAGE,
ptrName,
iValue,
Value,
Min,
Max)
then begin
ABSQuery1.ParamByName('HWM_ID').AsString:=inttostr(hwm_index);
ABSQuery1.ParamByName('Sensor_Class').AsString:=inttostr(SENSOR_CLASS_VOLTAGE);
ABSQuery1.ParamByName('Sensor_ID').AsString:=inttostr(sensor_index);

sField:=pansichar(ptrname);
sValue:=Format('%.3f V', [Value]);
sMin:=Format('%.3f V', [Min]);
sMax:=Format('%.3f V', [Max]);

ABSQuery1.ExecSQL;


end;
end;
end;
  Mit Zitat antworten Zitat