Delphi 与 ACCESS的诡异现象
delphi 2007 + access 2007 +odbc +TADODataset,TADOConnection,TADOCommand
//删除数据
procedure TCDSSelectTools.DeleteMachine(byMachineID: string);
tmpCmd := TADOCommand.Create(nil);
tmpConn := TADOConnection.Create(nil);
tmpConn.ConnectionString := gConnectionStrSelect;
tmpConn.Connected := true;
tmpConn.BeginTrans;
tmpCmd.Connection := tmpConn;
try
tmpCmd.CommandText := 'delete * from t_MachineInfo where sMachineID= ' + '''' + byMachineID + '''';
tmpCmd.Execute;
tmpCmd.Connection.CommitTrans;
finally
tmpCmd.Free;
tmpConn.free;
end;
end;
//3秒钟内执行这个过程肯定会ShowMessage
procedure TCDSSelectTools.GetMachine(byMachineID: string);
tmpDS := TADODataset.Create(Nil);
tmpDS.ConnectionString:= gConnectionStrSelect;
tmpDS.CommandText:='select * from t_MachineInfo where sMachineID= ' + '''' + byMachineID + '''';
try
tmpDS.Open;
if tmpDS.Recordcount>0 then
ShowMessage(tmpDS.FieldByName('FFunModelList').AsString); //这里竟然能显示出来
finally
相关问答:
我在模块里自定义了一个函数:stradd()
可是在adoquery1.sql.add('select stradd(author) from book');
时提示stradd未定义...
这个问题有什么办法可以解决的吗? 非常感激!
(在A ......
这两天学习《Delphi技术方案宝典》一书中第三章关于用户登录方案的例子,利用的是SQl Server数据库实现用户登录,编译运行都没问题,该实现的功能也都实现的很好,但是奇怪的是,反复运行一段时间后,有时在关闭整个 ......
昨晚在Delphi数据库查询中遇到了一个疑惑。代码如下:
procedure TFormSearchAchievement.ComboBoxXYChange(Sender: TObject);
var
XY : string;
begin
XY := comboboxxy.Items[comboboxx ......
VC 控制台程序:
#include <iostream>
using namespace std;
int main()
{
const int def_buffer = 1024 * 4;
DWORD t;
BYTE b[def_buffer];
memset(b, 0, sizeof(b));
PBYTE p;
t = GetTickC ......