dynamic string connection sql import

  • Thread starter Thread starter Dejan
  • Start date Start date
D

Dejan

Hi,

I am new to using Microsoft Acces, I know I need to use some VBA code
to do this job. Not sure where to start is someone could put me in the
right direction. Any help would be appreciated.


I have a connection string I need to use to import data into a single
table and by doing a sql query, i have 1000's of files i need to loop
through and import all the ino into one single table all files are
laid out exactly the same, same structure and field, table names etc.
I want to be able to grab a list of folders in c:\data\ it contains
1000's of folders ie 999 each folder has a folder called data inside
of it is the small database files, i need to get a listing of all the
folders so i can concatenate with connection string that i can loop
through all of them, get the data I need and import into one single
table in Access over and over.


My connection string is "ODBC;DRIVER={GTA ODBC for DATA};DBB=c:\data
\999\data\database.dat" and my sql statement:


select


*


from


PARTS


where


cust=899


So i need to import this data over and over again until I get every
single folder 1-1000... into one single table.


I hope someone can send me in the right direction.


Thanks
 
Since no one else has answered, I've got a relatively old way to do this.
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "DirectoryList.mdb" which illustrates how to get a directory
listing into a table. Then you could loop through your table, modify the
ODBC connection with each pass, and run your SQL statement.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Back
Top