QueryDefs in 2000

B

Brandon

OK...I barely get by in Access '97, and now I need to
write some code in '2000 that would be the equivalent of
a QueryDef statement.

I haven't been able to understand a word of what I've
read on the Internet about 'ADO', and have never used it
before.

Can you help my get by in Access 2000 without learning
these new procedures?

Here's some trimmed code similar to what I had been using
in '97:

Dim strSQL As String

strSQL = "SELECT DISTINCTROW ...."
strSQL = strSQL & " FROM Tbl_Main"
strSQL = strSQL & " WHERE ([some condition]);"

Dim qdf As querydef
Set qdf = CurrentDb.QueryDefs("Qry_Main")
qdf.SQL = strSQL
qdf.Close
RefreshDatbaseWindow

Much Appreciated!
 
A

Allen Browne

Hi Brandon. This is very easy to resolve, and something lots of us do:

1. From any code window, choose References from the Tools menu.

2. Deselect "MS ActiveX Data Objects (ADO) 2.xx".

3. Select "MS DAO 3.6 Library".

More info:
http://allenbrowne.com/ser-38.html
 

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