If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: Complete Database n00b.

Hey everyone!

Im an experienced Visual Basic programmer but have never ventured into the world of Access Databasing. But I have a task that ive got to complete and would be great if you guys could help me out.
What I have to do is Execute a Query and then save the database again. Thats the only bit I need help with as everything else I can do with ease. Is there anywhere I can read up on it? Thanks for your time shabba.

I suggest that you check out this tutorial at a sister-site: ADO Tutorial

Lou
使大吃一惊"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

If the query will return a set of data, (a SELECT query, for instance,) then pass to the query to the recordset.open method

Code:

' Declare/Instanciate ADO connection and recordset, Open the ADO connection. Then...
strSQL = "Select Field1, Field2 from Table1 Where Field1 is not Null"
rs.Open strSQL, Conn
' NOW, you can iterate through the recordset.
Do WHile not rs.EOF
debug.Print rs.Fields!Field1, rs.Fields!Field2
rs.MoveNext
Loop
rs.Close
set rs = nothing

If the query will NOT return data (An UPDATE, INSERT, or DELETE query, for instance, or any DDL queries,) you don't need to (or want to) instanciate a recordset for this. You just need to execute the command. So, issue a command to the ado connection.

Lou
使大吃一惊"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Was explaining when to use a recordset and when not. Plus, using the rs.open method.

Lou
使大吃一惊"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert