Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT into a certain row?? 1

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
In my db i have

qID (autonumber)
TheQuestion (memo)
TheAnswer (memo)

I am unsure as to how to insert into the db where qID = 1 etc.. so I can put them in the row the question is.

Thanks for any help..

-Jason
 
If you want to specify your Qid=1,2,3... you will need to
remove the "autonumber" property from the field in your
table. You should make Qid as a non-duplicated primary key.

If you use autonumber, you are relying on the database to
select your next Qid. This may or may not be 1 to start.
Do not include Qid in your insert statement in this case.

Good luck!
 
First of all you can't do a insert statement with a true where cluase. You can update a row and use a where clause to define the row you are updating, but a insert creates a new row.

The problem is, and this depends slightly on which DB you are using. You can't insert into the autonumber field. This is a field that the DB itself populates when you create the row. So to have the questions/answers be in the order, you would need to insert them that way.

If you tell us what DB you are using, we might be able to better answer this question. The money's gone, the brain is shot.....but the liquor we still got.
 
Dynapen - you answered my question, i need to use update to do what I want..thanks alot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top