Thema: Delphi SQL problem

Einzelnen Beitrag anzeigen

nanix
(Gast)

n/a Beiträge
 
#23

Re: SQL problem

  Alt 7. Dez 2009, 14:28
I tryed executing after and it makes no diffrence

Delphi-Quellcode:
for hwm_index := 0 to NBMonitors - 1 do begin

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.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';
ABSQuery1.ExecSQL;
Edit1.Text:=ABSQuery1.SQL.Text;



end;
end;
end;
end;
  Mit Zitat antworten Zitat