z****g 发帖数: 2497 | 1 I use SQL "Insert" to fill data into an Access *.mdb file.
And in the field "CompID", I set it as AutoNumber,
it should fill itself automatic when you fill in data in
database.
But it doesn't work when use Insert. It need me to put a
value to that field too. So, it is not automatic.
How to solve this problem?
Thanks for help! | s***l 发帖数: 9 | 2
I am not clear to ACCESS. But in SQL SERVER 7.0, you can
simply omit the field when inserting new values.
【在 z****g 的大作中提到】 : I use SQL "Insert" to fill data into an Access *.mdb file. : And in the field "CompID", I set it as AutoNumber, : it should fill itself automatic when you fill in data in : database. : But it doesn't work when use Insert. It need me to put a : value to that field too. So, it is not automatic. : How to solve this problem? : Thanks for help!
| a*****a 发帖数: 438 | 3 i just tried and it worked..
I created a table CompCEO with two columns, 'CompID'
(autonumber) and 'CEOName'(text).
then I inserted two records by:
INSERT INTO CompCEO VALUES (1, "amnesia")
INSERT INTO CompCEO (CEOName) VALUES ("amnesia")
SELECT * FROM CompCEO
everything works.
【在 z****g 的大作中提到】 : I use SQL "Insert" to fill data into an Access *.mdb file. : And in the field "CompID", I set it as AutoNumber, : it should fill itself automatic when you fill in data in : database. : But it doesn't work when use Insert. It need me to put a : value to that field too. So, it is not automatic. : How to solve this problem? : Thanks for help!
|
|