View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
onedaywhen onedaywhen is offline
external usenet poster
 
Posts: 459
Default Export information to Access.

Su

Sub tester()

Dim oConn As Object
Dim lngRowsAffected As Long
Set oConn = CreateObject("ADODB.Connection")

With oConn
.ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0;" & _
"Data Source=C:\Tempo\New_Jet_DB.mdb"
.Open
.Execute "INSERT INTO MyTable" & _
" SELECT MyCol1 AS RefID, " & _
" MyCol2 AS Surname" & _
" FROM [Excel 8.0;Database=C:\Tempo\db.xls].[Sheet1$]", _
lngRowsAffected
.Close
End With

End Sub

--

"JVS" wrote in message ...
Trying to automate an import process.
Could some one share the code to export all the data from a specific Excel
sheet to an existing Access database table?

Thanks!
jvs