TSimpleDataSet的使用方法 (100分)

G

gzgchan

Unregistered / Unconfirmed
GUEST, unregistred user!
有下面的一段代码,是通过dbExpress向数据库中添加资料,其中SQLConnection1、SimpleDataSet1已配置好调用mySQL数据库,
但是运行下面代码时,不会报任何错误(通过)。但是发现实际数据库中并未改动过,是何原因?

其中CommandType已设为ctTable;

type
TForm1 = class(TForm)
SQLConnection1: TSQLConnection;
SimpleDataSet1: TSimpleDataSet;
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
SimpleDataSet1.Append;
SimpleDataSet1.FieldByName('name').asstring:='First Name';
SimpleDataSet1.post;
SimpleDataSet1.Close;
end;
end.
 
差一个提交函数
applyUpdates(-1)
 
成功,竟然是这个。我以为不用那

谢谢,已给分。
 
此程序编译为 .exe 就可以正常执行,但是我将他做成 .dll 后,
执行到 applyupdates(-1) 就报错:

ERROR: Commands out of sync; You can't run this command now


何原因?
 
顶部