procedure TFormSetSystem.btnConfigClick(Sender: TObject);
var
sqlstr: string;
begin
with qryConfigExec do
begin
sqlstr :='UPDATE SetConfig SET '+
'Byte1Bit0 = : Byte1Bit0,'+
'Byte1Bit1 = : Byte1Bit1,'+
'Byte1Bit2 = : Byte1Bit2,'+
'Byte1Bit3 = : Byte1Bit3,'+
'Byte1Bit4 = : Byte1Bit4,'+
'Byte1Bit5 = : Byte1Bit5,'+
'Byte1Bit6 = : Byte1Bit6,'+
'Byte1Bit7 = : Byte1Bit7,'+
'Byte2Bit0 = : Byte2Bit0,'+
'Byte2Bit1 = : Byte2Bit1,'+
'Byte2Bit2 = : Byte2Bit2,'+
'Byte2Bit3 = : Byte2Bit3,'+
'Byte2Bit4 = : Byte2Bit4,'+
'Byte2Bit5 = : Byte2Bit5,'+
'Byte2Bit6 = : Byte2Bit6,'+
'Byte2Bit7 = : Byte2Bit7 '+
'WHERE ConfigID = '''+edt1.Text+'''';
Close;
SQL.Clear;
SQL.Add(sqlstr); Parameters[0].Value := cbbByte1Bit0.ItemIndex;
Parameters[1].Value := cbbByte1Bit1.ItemIndex;
Parameters[2].Value := cbbByte1Bit2.ItemIndex;
Parameters[3].Value := cbbByte1Bit3.ItemIndex;
Parameters[4].Value := cbbByte1Bit4.ItemIndex;
Parameters[5].Value := cbbByte1Bit5.ItemIndex;
Parameters[6].Value := cbbByte1Bit6.ItemIndex;
Parameters[7].Value := cbbByte1Bit7.ItemIndex; Parameters[8].Value := cbbByte2Bit0.ItemIndex;
Parameters[9].Value := cbbByte2Bit1.ItemIndex;
Parameters[10].Value := cbbByte2Bit2.ItemIndex;
Parameters[11].Value := cbbByte2Bit3.ItemIndex;
Parameters[12].Value := cbbByte2Bit4.ItemIndex;
Parameters[13].Value := cbbByte2Bit5.ItemIndex;
Parameters[14].Value := cbbByte2Bit6.ItemIndex;
Parameters[15].Value := cbbByte2Bit7.ItemIndex;
try
ShowMessage(qryConfigExec.SQL.Text);
ExecSQL;
with qryConfigShow do
begin
Close;
Open;
end;
MessageBox(Handle, PChar('修改项目配置成功'), '提示信息', MB_OK + MB_ICONWARNING);
except
MessageBox(Handle, PChar('修改项目配置失败'), '提示信息', MB_OK + MB_ICONWARNING);
end;
end;
end;
解决方案 »
- 白送分:关于设置delphi2007中vcl工程窗口标题的问题!
- string转Tstream
- 指针传递参数的问题,HELP
- 利用网页制作了一个表情图的选择功能,如何判断选择的图片???????????
- 【散分】教个朋友!聊Delphi的,不管MSN/QQ/Yahoo!Messger/POPO/IMU
- 托蒂有一本《托蒂笑话集》,爱老大(aiirii)也写一本《aiirii笑话集》吧?
- DLL中的类如何注册?
- 问题:关于:FastReport的Memo问题:
- 左右模糊
- 一个关于字符串的问题,问了我们公司最厉害的程序员,不懂。有兴趣的话进来看一下
- 写入注册表时错误'Unable to write to \Software\xxx\xxx'
- 串口通讯问题,请大家帮忙看看。
冒号与Byte1Bit0之间不能有空格,下面相似语句同样的道理。