Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to insert value of field having autofield data type with access database..???
i need a insert query for this....!!!!

Example:-
i have table having two filed (no autonumber,name text)
now i want to take a input from use of name and autonumber do thier work automaticalyy then what will be the insert query ???
Posted
Updated 26-Jan-13 19:57pm
v2
Comments
Sandeep Mewara 27-Jan-13 1:49am    
Not clear. Please rephrase & Elaborate.

1 solution

Let's make clear:
A) you want to override the value that would be generated with a value coming from elsewhere?
Sorry, but you can't do that in access :(.

B) you want to make the number generation to work?
In this case you simply have to omit totally that field from the insert statement.
 
Share this answer
 
Comments
vihangshah 27-Jan-13 23:29pm    
ya B option is proper but when i omit that field then fire a exception .....!!!! now what to do ??/
Zoltán Zörgő 28-Jan-13 0:29am    
If you issue a "select into" statement directly, you should not get any exception. But if you use other tools, where you populate field objects, you should care about specifying on c# side, that the "no" field is autonumber. But the exact way depends on what you are using, so please update your original question with the code sequence you are using to insert.
vihangshah 4-Feb-13 4:51am    
i have table having two filed (no autonumber,name text)
now i want to take a input of name field from user and autonumber do their work by thier own so now tell mw the INSERT query which one i write on my coding page ???
Zoltán Zörgő 4-Feb-13 5:26am    
I can't tell more, than I already have. If you use autonumber, you can not override it in an insert statement. That is a limitation in access.
fjdiewornncalwe 14-Mar-13 14:02pm    
My 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900