1 http://community.csdn.net/Expert/topic/3794/3794910.xml?temp=.6415064
2 DataTable objTable = new DataTable("NewBooks"); // declare a variable to hold a DataColumn object
DataColumn objColumn; // define the columns (fields) within the table
// the first is an AutoIncrement column to act as the key
objColumn = objTable.Columns.Add("kBookKey", Type.GetType("System.Int32"));
objColumn.AutoIncrement = true;
objColumn.AutoIncrementSeed = 1000;
objColumn.AutoIncrementStep = 10;
2 DataTable objTable = new DataTable("NewBooks"); // declare a variable to hold a DataColumn object
DataColumn objColumn; // define the columns (fields) within the table
// the first is an AutoIncrement column to act as the key
objColumn = objTable.Columns.Add("kBookKey", Type.GetType("System.Int32"));
objColumn.AutoIncrement = true;
objColumn.AutoIncrementSeed = 1000;
objColumn.AutoIncrementStep = 10;
1.
_________________________________________________________________
第一个 在access数据中也不能直接得到 @@IDENTITY 都是sql server中的吧
_________________________________________________________________
那么在access中如何实现呢,难道就没有办法了吗?2.
_________________________________________________________________
第2个问题 不可能实现
_________________________________________________________________
我怎么看到别人的用access,序号可以从10000001开始,如何实现?up也有分,急!,谢谢
他可能是普通的int
新记录插入的时候值为max(id)+1
当然,你可以用自动编号,插入10000条记录然后删除,就从10001开始了
插入完后,执行 SELECT MAX(ID) FROM tablename 返回最后的编号2. 在表新建立以后,首先执行一条测试插入,语句如下 :
INSERT INTO tablename(ID,xxx,xxx,...) VALUES (10000,xxx,xxx,...)
以后,在插入时用 INSERT INTO tablename (xxx,xxx,...) VALUES (xxx,xxx,...)
该表的ID从 10000 开始