Update Access DB With Downloaded Data

A

ags5406

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.
 
N

nick.defauw

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(ByVal sURL As String, ByVal sImg As
String) As String

Dim sDbPath As String = "C:\crawl\dbo.index.mdb"
Dim AccessConnection As New
System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;"
& "Data Source=" & sDbPath)
Dim InsertCommand As New System.Data.OleDb.OleDbCommand
Dim queryURL As New System.Data.OleDb.OleDbCommand
Dim sID As String = UCase(Generate())
AccessConnection.Open()

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

InsertCommand.Connection = AccessConnection
InsertCommand.ExecuteNonQuery()

AccessConnection.Close()
AccessConnection = Nothing

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top