Logo 
Search:

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: 819
  

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

Share: 

 

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

oConn.Close
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.




Tagged: