+ Reply to Thread
Results 1 to 1 of 1

Push Excel data to Acces

Hybrid View

ArrowL Push Excel data to Acces 02-14-2012, 08:04 PM
  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Push Excel data to Acces

    Hi,
    I am tring to push Excel 2010 data into Access.

    I have the code below but it keeps getting errors.


    Thanks all.


    Private Sub CommandButton1_Click()
    
        Dim con As New ADODE.Connection
        Dim connectionString As String
        
        Dim sql As String
        
        connectionString = "filename; Driver={Microsoft Access Driver (*accdb)};"
        
        con.Open connectionString
        
        sql = "insert into tbl_names (First, Last) values('" & TextBox1.Text & "', '" & TextBox2.Text & "')"
        
        con.Execute sql
        
        MsgBox "Values entered", vbInformation
        
        con.Close
        
        Set con = Nothing
        
        
    End Sub
    Last edited by ConneXionLost; 02-14-2012 at 08:19 PM. Reason: Added code tags

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1