Update Access DB With Downloaded Data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ags5406

    #1

    Update Access DB With Downloaded Data

    Novice to Visual Studio 2005 - in the past have used VB6, Excel VBA,
    Access VBA.

    I want to download a set of data daily from a website which I then put
    into a text array. This part I've done and it works well.

    I want to store new data in an Access 2003 database. So daily I want
    to compare my new data to data in my Access db and then add certain
    parts of the new data as new Access records if they fit a particular
    criteria.

    I've figured out how connect the DB and add the DB as a data source.
    And I have created the TableAdapter.

    I can't figure out how to actually get the data from the DB, compare
    it to my new data, and get the new data back into the DB.

    Any suggestions? Does it even sound like I'm on the right track? A
    "for dummies" explanation would help. Thanks.

  • nick.defauw@careerbuilder.com

    #2
    Re: Update Access DB With Downloaded Data

    On Mar 9, 3:59 pm, "ags5406" <m_cash_stra... @hotmail.comwro te:
    Novice to Visual Studio 2005 - in the past have used VB6, Excel VBA,
    Access VBA.
    >
    I want to download a set of data daily from a website which I then put
    into a text array. This part I've done and it works well.
    >
    I want to store new data in an Access 2003 database. So daily I want
    to compare my new data to data in my Access db and then add certain
    parts of the new data as new Access records if they fit a particular
    criteria.
    >
    I've figured out how connect the DB and add the DB as a data source.
    And I have created the TableAdapter.
    >
    I can't figure out how to actually get the data from the DB, compare
    it to my new data, and get the new data back into the DB.
    >
    Any suggestions? Does it even sound like I'm on the right track? A
    "for dummies" explanation would help. Thanks.
    Private Function db_InsertPage(B yVal sURL As String, ByVal sImg As
    String) As String

    Dim sDbPath As String = "C:\crawl\dbo.i ndex.mdb"
    Dim AccessConnectio n As New
    System.Data.Ole Db.OleDbConnect ion("Provider=M icrosoft.Jet.OL EDB.4.0;"
    & "Data Source=" & sDbPath)
    Dim InsertCommand As New System.Data.Ole Db.OleDbCommand
    Dim queryURL As New System.Data.Ole Db.OleDbCommand
    Dim sID As String = UCase(Generate( ))
    AccessConnectio n.Open()

    InsertCommand.C ommandText = "INSERT INTO crawlIndex([uID],
    [IMG],[URL]) VALUES ('" & _
    sID & "','" & sImg & "','" & sURL
    & " ');"
    db_InsertPage = sID

    InsertCommand.C onnection = AccessConnectio n
    InsertCommand.E xecuteNonQuery( )

    AccessConnectio n.Close()
    AccessConnectio n = Nothing

    End Function

    Comment

    Working...