DoCmd.RunSQL command help needed

T

Tcs

Can I run a pass-thru query from VB using this command? I have a saved query
that works. It pulls data from our AS/400 just as it should. It works in
conjunction with a local query that Access (2000) uses to build a local table
(on my PC). I know I can use the DoCmd.OpenQuery, but my parameters are
variable. Sooo...

In VB, I build my SQL statements. Then I use the DoCmd.RunSQL command. I've
inspected the SQL statements that I build. VB has created what I have told it
to build. But it just dawned on me that perhaps what my problem really is, is
that Access can't tell the one of these is a PASS-THRU query. That it is, in
fact, trying to run it locally, and can't do it. Which brings me back to my
original question...

Can I run a pass-thru query from VB using the DoCmd.RunSQL command? If so, how?

Thanks in advance!
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Don't know about RunSQL & pass-thru queries & don't care. RunSQL is old
method, don't use it. Use the .Execute method of the Database and
QueryDef objects, if the query is an action query. If a select query,
use OpenQuery if you want to display a datasheet result; otherwise, use
Database and QueryDef objects' OpenRecordset method to put the resultset
into a recordset variable.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQTZTwoechKqOuFEgEQJzPACg5Uh0MjHc/H/7GtrZgOhGG6I8c+MAoJ28
OwmXnEpsxSpl8+35Bd4nK/77
=dVon
-----END PGP SIGNATURE-----
 

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