Best solution for this problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am currently using Access 2000 to communicate with a Oracle 8.1 database.
I need to build queries for other people gathering the information that they
want. Basically, I want them to tell me what they want and then I run the
query and send them back the info in an excel spreadsheet. One problem is
that these can be pretty complicated queries. Another problem is that I am
just an intern and want them to be able to use this after I leave. I have
found that using pass through queries is significantly faster than using jet
queries and some of my queries seem to be too complicated for the design
grid. I like the pass through queries but I would like to be able to change
the parameters for the query using a form which im not sure how you would go
about that. I was thinking that I could write everything in VBA and use VBA
to send the query directly to the database. Im familier with basic VB but
not so much with VBA for Access but I am willing to learn. Do you think that
this is the best solution for this problem? Also, how would I go about doing
it? Ive heard of OBDCdirect. Is this what I need? Thanks

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

Yes, use VBA to create the SQL string. Then place that string in a pre
existing pass-thru QueryDef. E.g.:

strSQL = "SELECT * FROM table"

Dim db As DAO.Database
Dim qd As DAO.QueryDef
Set db = CurrentDb
Set qd = db.QueryDefs("myQuery")
qd.SQL = strSQL

' Now either run the query
DoCmd.OpenQuery "myQuery"

' or, use in a recordset
Set rs = qd.OpenRecordset()

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

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

iQA/AwUBQ95/R4echKqOuFEgEQJ3BACg8m8EIJ+BXlXeJyXGriD977Tn1O0AoJY+
fANXt3lZaRLnlKDlcTs6iF0X
=ir/B
-----END PGP SIGNATURE-----
 
Back
Top