Click here to Skip to main content
13,003,516 members (57,831 online)
Rate this:
Please Sign up or sign in to vote.
See more:
how to insert value of field having autofield data type with access database..???
i need a insert query for this....!!!!

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 26-Jan-13 17:05pm
Updated 26-Jan-13 19:57pm
Sandeep Mewara 27-Jan-13 1:49am
Not clear. Please rephrase & Elaborate.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
vkshah1 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.
vkshah1 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.
Marcus Kramer 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170626.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100