数据库SQL SERVER 7.0
CREATE TABLE abc (
[id] [int] IDENTITY(1,1) not null,
[name] [varchar] (40) not null,
...
)
我在用Delphi编程时,用TTable不知道怎么插入一条新记录
TTable t;
t.Insert;
...
上面结果出错
CREATE TABLE abc (
[id] [int] IDENTITY(1,1) not null,
[name] [varchar] (40) not null,
...
)
我在用Delphi编程时,用TTable不知道怎么插入一条新记录
TTable t;
t.Insert;
...
上面结果出错
begin
append;
fieldbyname('name').asstring := xxxxxxxxxxxxx;
fieldbyname('.............
post;
//不要写入id字段。
end;
另外最好把ID这个字段名称换一个,比如叫CustomerID, PKID之类
系统保留字。
你没有搞错吧。不可能不行呀,你 Post 没有?
其它 identity屬性還是蠻好使的
要查增到哪兒了,
可以用identity(table )
函數