+ Reply to Thread
Results 1 to 15 of 15

Pull data from Access

Hybrid View

  1. #1
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Pull data from Access

    Hi sujitshukla
    what code do you have sofar?
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  2. #2
    Registered User
    Join Date
    02-28-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Pull data from Access

    Quote Originally Posted by pike View Post
    Hi sujitshukla
    what code do you have sofar?
    Hi,

    this is the code i am using

    Private Sub CommandButton1_Click()
    Dim con As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim r As Long
    con.Open "Provider=Microsoft.Jet.Oledb.4.0; " & _
    "data Source=C:\Documents and Settings\Administrator\Desktop\db1.mdb;"
    rs.Open "tbl_name", con, adOpenKeyset, adLockOptimistic, adCmdTable
    r = 6
    Do While Len(Sheet1.Range("A" & r).Formula) > 0
    With rs
    .AddNew
    .Fields("NAME") = Sheet1.Range("B" & r).Value
    .Update
    End With
    r = r + 1
    Loop
    rs.Close
    Set rs = Nothing
    con.Close
    Set con = Nothing



    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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