method to Scan tables in one directory

  • Thread starter Thread starter souris
  • Start date Start date
S

souris

I am looking for a easy way to scan all the dbf tables in one directory and
import them in to my SQL server database using MS Access as front end
application,

Any information is great appreciated,


Souris,
 
I am looking for a easy way to scan all the dbf tables in one directory and
import them in to my SQL server database using MS Access as front end
application,

Any information is great appreciated,


Souris,

Take a look at the VBA help for the Dir() function. You should be able
to use Dir() to find all the .dbf files in a directory and step
through them.

John W. Vinson[MVP]
 
Thanks for the information,

I use Dir() function to scan all the files.
I need copy the data structure to my SQL server database, because the
structure is unknown.
I tried 'DoCmd.CopyObejct', 'DoCmd.CopyDatabaseFile' and
'DoCmd.TransferDatabase', None of them works.
Do you have any idea which command that I can copy the database structure?

Thanks again,

Souris,
 
Thanks for the information,

I use Dir() function to scan all the files.
I need copy the data structure to my SQL server database, because the
structure is unknown.
I tried 'DoCmd.CopyObejct', 'DoCmd.CopyDatabaseFile' and
'DoCmd.TransferDatabase', None of them works.
Do you have any idea which command that I can copy the database structure?

If you have a linked dBase file (which you can do with
TransferDatabase) and linked SQL tables (likewise or they can be
permanently linked), then you can base an Append query upon the dBase
file and append the data into the SQL table.

John W. Vinson[MVP]
 
Because I do not know the structure of the table, I can not have a
permanently linked SQL table.
I have to create a SQL table base on the table structure.

May I use
'DoCmd.CopyObject' to copy my dbf table structure to my SQL server?

Thanks again for the information,

Souris,
 
Because I do not know the structure of the table, I can not have a
permanently linked SQL table.
I have to create a SQL table base on the table structure.

Hrm. I don't know if a MakeTable will work - probably not.

You may need to use DAO or ADO to loop through the linked dBase
table's Fields collection and construct a SQL DDL query. Given the
fact that you have three different dialogs of SQL and table
conventions involved this may be tricky!


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top