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!

SQL for insert

Status
Not open for further replies.

Watermelon

Programmer
Apr 16, 2001
68
US
Hi,

Does anyone know how to do a sql insert that will insert multiple records into multiple fields? (I want to insert a part number, description, and listprice into one table).
How would I write a SQL statement for this? And how would I execute this from a form?

Thanks for any help,
TM
 
You will need to run the SQL once for each record you want to insert.

I'm not sure why you would use Insert instead of using a form that is based on the table. Then the form can be set to data entry and all data entered will go into the table.

Can you give us an idea of what you are trying to do? Kathryn


 


Try the following

INSERT INTO destination (field1, field2, ...)
VALUES (value1, value2, ...)
replacing destination etc with your tablename,fieldnames and values

this will work with the microsoft jet engine
::)
 
Hi,

I'll probably try that insert you described (sdh). Kathryn,
I'm not thinking of using a form because I'm using a shopping cart button. The shopping cart button is on a "Parts" form but when the shopping cart button is pressed the order information is going to go into a orders table. So, I'm not sure how else to insert into the "Order" table from the "Parts" form without doing a SQL insert. If you have another idea please let me know?

Thanks,
TM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top