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

how to open sql scripts file and pass it to access

Status
Not open for further replies.

xq

Programmer
Jun 26, 2002
106
NL
sql scripts will be saved as text file, i have to use user form to open it and pass it to query access database and get the result.
How to write a piece of code to read a text file and pass it to access? thanks a lot if anyone would help me out!
 
Are you talking about appending a table with the text file?
 
just query the table, i know how to write sql in VAB code to query the tables, but what i have to is to open a text file which has all the sql scripts, read it and query the database.
 
sub get_sql_script()

dim text_sql as string

open "c:\folder\sql_text.txt" for input as #1
lineinput #1, text_sql
close

docmd.runsql text_sql
 
thanks a lot! i'll try it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top