QueryDefs in 2000

  • Thread starter Thread starter Brandon
  • Start date Start date
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!
 
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
 
Back
Top