易截截图软件、单文件、免安装、纯绿色、仅160KB

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
 


相关问答:

ACCESS的自定义函数在delphi里怎么用呢...

我在模块里自定义了一个函数:stradd()

可是在adoquery1.sql.add('select stradd(author) from book');
时提示stradd未定义...

这个问题有什么办法可以解决的吗? 非常感激!


(在A ......

错误信息Access violation....

这两天学习《Delphi技术方案宝典》一书中第三章关于用户登录方案的例子,利用的是SQl Server数据库实现用户登录,编译运行都没问题,该实现的功能也都实现的很好,但是奇怪的是,反复运行一段时间后,有时在关闭整个 ......

Delphi中数据库查询的疑惑

昨晚在Delphi数据库查询中遇到了一个疑惑。代码如下:
procedure TFormSearchAchievement.ComboBoxXYChange(Sender: TObject);
var
  XY : string;
begin
  XY := comboboxxy.Items[comboboxx ......

VC Delphi 内存速度比较 - VC/MFC / 非技术类

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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号