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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run SQL queries from textfile

Status
Not open for further replies.

delpino

Programmer
Dec 29, 2000
17
0
0
GB
Hiya..

I've got a plain textfile with a couple of SQL update-statements.

updatefile.sql:

UPDATE lots SET lots.cid = 1123 WHERE (((lots.ID)=23))
UPDATE lots SET lots.cid = 1123 WHERE (((lots.ID)=34))

...

how can i run these in access so that it updates my table.
I looked for an answer in this forum with no success.




 
Hmmm... Create a table with a text field, import the text file into the table, loop through the table and for each record, load a txtString variable and run the DoCmd.RunSQL passing it that string? Terry M. Hoey
 
is there an easier way to do that? my programming skills in access are not very good.

in phpMyAdmin (for MySQL) you just point to the textfile and execute it..much easier
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top