
Best way to run lots of SQL commands?
Access uses querydef objects okay and it is also a jet system - so the
opendatabase function works very nicely provided you have a reference to DAO
in your project. Running queries is pretty simple - you don't actually have
to create a querydef object unless you want to store the query for all time
in the database or if you are using it as a through query.
To do this create your SQL string and then enter;
db.execute [SQL String],[options]
where db is a defined database variable.
To create the querydef object, again create your string then;
Set qd = db.CreateQueryDef("MyQueryName",[SQL String])
Where qd is a defined querydef object and db is the same as before.
qd.Execute [Options]
runs the query.
Hope this is of some help.
Cheers,
Davy
Quote:
> After having gone through the manuals and such I am a little lost on how
to
> simply program some SQL commands on a dataset, and manipulate the results.
> I am using Visual Basic 6.0 and the databases are currently in Access
2000.
> One approach is to use Opendatabase command with a Query Def. But
apparently
> the source cannot be a microsoft jet database, which I believe is what
Access
> is. Then again, I am not sure.