Append specific Data From SQL Server To MS Access Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Serenityquinn15
    New Member
    • Oct 2007
    • 30

    #1

    Append specific Data From SQL Server To MS Access Table

    Hi!
    I was wondering if it is possible to get the specific data coming from SQL Server 2000 and append it to my MS Access Table through VB Code????
    If it so, please advise me on how i can do this kind of importing Data.

    Thank You
  • mafaisal
    New Member
    • Sep 2007
    • 142

    #2
    Hello

    Create 2 Connection 1 for sql And another for Access
    Using First connection Select Fields from SqlTable

    Then Insert or update int Acces using 2 Connection

    Faisal

    Comment

    • Serenityquinn15
      New Member
      • Oct 2007
      • 30

      #3
      Thank You for the Information. However, I created this code so far but i dont know why isn't working, here's my code:

      Dim strSql As String

      strSql = "INSERT INTO OpenDataSource( 'Microsoft.Jet. OLEDB.4.0','Dat a Source=" & App.Path & "\Extract.MDB;' )...[Sam_Timedata] ([EmployeeID],[Pin],[Timedata],[Count],[InOut],[strEmployeeID]) " & _
      "SELECT EmployeeID, Pin, Timedata, Count, InOut, strEmployeeID From dbo.Timedata;"
      adCon.Execute strSql (FYI: adCon is my SQL Server Connection)

      The Error say's "OLE/DB provider returned msg"Microsoft.J et.OLEDB.4.0',' Data Source=" & App.Path & "\Extract.M DB' is not a valid path. Make sure that the path name is spelled correctly and that your are connected to the server on which the files resides."


      but actually, when i checked the path it was correct and I dont know what the system means about this,.. Any Advise. thank you.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        it seems you lack basic knowledge of connection and SQL.

        Please refer to Howtos section of VB in the forum for some related articles.

        Comment

        Working...