·
Open the text file
·
Save the contents of the current line to appropriate variable(s)
·
Use Access’s DoCmd.
RunSQl method to execute the SQL statement found in the current line in the
text file
·
Continuously loop through the text file until
its end
How to do it
Useful commands file I/O material
Command
|
Note
|
Read a line up until the carriage return and assigns it to a variable
|
|
Read CSV data into variable(s)
|
|
Input function returns all of the characters it reads and unitl the
EOF –into one variable,
|
|
Data written with Write # is usually read from a file with Input
#.; Writes data to a file – separate by commas
|
|
Data written with Print # is usually read from a file with Line
Input # or Input
|
|
Data read with Get is usually written to a file with Put
|
|
EOF(n)
|
|
Open a file for input or output
|
|
Close a file
|
This input file contains SQL statement that insert data into a table
Figure 1
Figure 2
No comments:
Post a Comment