Disable AutoNumber in MS Access 2000 Database
Currently in one of our legacy system's database has one of its columns set to AutoNumber. I am investigating if there is a work aroun开发者_StackOverflowd to circumvent this to allow the program to enter its own values into this column.
Perhaps some way to programatically disable the AutoNumber-ing process then re-enabling it again?
What is the problem? You can insert your own numbers into an autonumber field as long as they are unique, but if you want your own numbers, you should not be using an autonumber.
Use Alter Statements and Adox for changing the fieldtype from autonumber to integer
Hope this helps :)
No you can't modify the type of the column of the database through a C# program. You have to change the Column type of the Column in Design View
of the Table column in the MS-Access
.
Update: You can change the type of Column if it is an AutoNumber but after adding the data, you wont get back to AutoNumber.
精彩评论