Create a button to automatically import SQL table Access 2007

I found these instructions: First, manually go through the Wizard, and before you get to the last step where you actually import the data, click on the Advanced button and save you Import Specification (give it a name).

Then create a macro to import the data (using the TransferText command). The Help will tell you what it needs in each argument.

Now, if you highlight that macro, you can go to the Tools button and select Macro | Convert Macros to Visual Basic. This will give you the code that you need to place behind your command button to automatically import your files.
My problem in trying to follow them is: The Advanced button never comes up. Also, I really need a way to replace the data in the existing table, rather than create a new one. Some of the things I have read say: If you Choose Create a new table and the table exists, it will overwrite it. I also do not get the choice of create or append.
I only get: Import the source data into a new table in the current database (I am choosing this one)
The other choice is Link to the data source by creating a linked table(Not what I want to do).
Then I choose my data source and import table, It goes straight to All objects imported sucessfully. There is a check box to Save the import steps. I checked it. Entered the save as information. Clicked Save Import.
qbjgqbjgConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

karunamoorthyCommented:
I had an experience of importing test file, dbf file etc into access table. What i did was to create a vb exe file and put it in a windows task scheduler and the table creation and data updation takes place automatically without any user intervention.

If it is possible to share sample text file along with field structure, I can give you the complete coding for you to finish your task.

from
Karunamoorthy
0
qbjgqbjgConsultantAuthor Commented:
I am not a VB programmer. The table I am importing is from SQL database. It cannot be done automatically. It will need for the user to start it, since they have some tasks to complete to get the SQL table "ready".
0
qbjgqbjgConsultantAuthor Commented:
I am also very new to Access.
0
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

qbjgqbjgConsultantAuthor Commented:
I am importing using an ODBC connection.
0
karunamoorthyCommented:
then this may help, if you follow it,
pl check out this URL
http://msdn.microsoft.com/en-us/library/bb177406(v=office.12).aspx
0
qbjgqbjgConsultantAuthor Commented:
That information seems to apply just to Text files, not SQL.
0
qbjgqbjgConsultantAuthor Commented:
Are there settings to change that might help me get advanced to show up and to get the import to overwrite the existing table?
0
qbjgqbjgConsultantAuthor Commented:
To solve the overwrite problem, it looks like I need to Delete the existing table, then import the sql table. So, if I can get some code to do those things I will be in good shape.
0
karunamoorthyCommented:
You can delete table data using

DELETE [Table1].* FROM [TABLE1];
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
karunamoorthyCommented:
Hello qbjgqbjg,
Any comments pl
0
qbjgqbjgConsultantAuthor Commented:
Thanks. The delete is helpful. Now the only thing I need is how to do the import using a button.
0
qbjgqbjgConsultantAuthor Commented:
It looks like I have what I need. Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.