• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

SQL involving Visual Basic 6.0 and Microsoft Access 2000

sandmanwake

Golden Member
I've got a VB module which downloads information from a website, now I want to store that information into Access 2000 tables. How do I do that with VB and SQL statements? Where in VB do I place these SQL statements?

I'm assuming that first I have to specify the database source to write into; something like:
SomePointer = Path_to_Access_File. What's the correct syntax for this? Once again, where in VB do I place these SQL statements?

Then, I suppose it'll be SomePointer.Table_Name.Row = Some_Value_From_Web until I input all the data.

Anyone able to help me out?
 
You need to go into references and add a reference to Microsoft ActiveX Data Objects (ADO). Then go to MSDN and look at an example using ADO. You'll need to find out what the connection string needs to be (tells ADO you are using Access and the location of the database). Then you open the connection to the table, add a new record, fill out the values, and update the record. You don't need to use SQL unless you want to.
 
You say this module downloads data from a website. Where does it d/l it to and in what form? Is it a simple text file, comma delimited, etc..?
 
This module is going to be edited with the database code as a function. As it's downloading and parsing the webpage into strings, each string will be written to the database to update it if there are any changes or if there is no current information, write new records. Below is more or less what I want happending. The arrows point to code that deal with the database that still needs to be added.


open database connection
while still parsing
{
Current code parses out a string from web page.
-->if new string is same as old string, do nothing
-->else, write parsed out string to database (update the old information), perhaps with a function call
}
close database connection
 
You have to have a way to determine what table you want to insert the strings into. After that it's a pretty simple operation to insert the data. You would put the code right after you do your check on whether or not the string has changed.
 
Back
Top