MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Putting data from xls into mdb

  Asked By: Sunil    Date: Jan 18    Category: MS Office    Views: 1073

Have you got any idea reganding to putting info from excel xls to
access mbd using vba?



1 Answer Found

Answer #1    Answered By: Gustavo Costa     Answered On: Jan 18

Here is a simple example

Sub AddData()
Dim oConn As Object
Dim oRS As Object
Dim sSQL As String

Set oConn = CreateObject("ADODB.Connection")
oConn.Open = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "c:\bob.mdb"

sSQL = "INSERT INTO Contacts (FirstName, LastName,Phone, Notes) " &
" VALUES ('Bob','Phillips','01202 345678','me')"
oConn.Execute sSQL

Set oConn = Nothing
End Sub

Didn't find what you were looking for? Find more on Putting data from xls into mdb Or get search suggestion and latest updates.