ADOBO control of Access Make Table query

P

Peter G

I have linked an Excel workbook from a table in an Access database. In order
for the data in the table to be correct it is updated by a "Make table query"
in the same Access database. I need to be able to update the query from Excel
and have tried the folllowing code

Sub UpdateAccess()
Dim con As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim SQL As String

MyFile = "C:\Bas\FTG1.mdb"
SQL = "SELECT Levfakt.Levnummer, Levfakt.Fakturadat INTO AAA_Tabell FROM
Levfakt"
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MyFile & ";"
rst.Open SQL, con, adOpenStatic


End Sub

My problem is that when I run the code I get an error message stating that
"The Table 'AAA_Tabell' arready exists"

Any suggestion how to change the code?
 

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

Top