Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Conversion / February 2008

Tip: Looking for answers? Try searching our database.

Converting old DAO syntax (i.e. Openquerydef)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JGawlik - 10 Feb 2008 00:54 GMT
I have been called to convert an old Access 97 database to Access 2003.  I
haven't worked in Access for a long time and would appreciate a push in the
right direction.

I've converting the data and code databases and got them linked.  When I
compile the code, it stops on the OpenQueryDef line:

Set qs = db.OpenQueryDef("qryAppend Billed_Fees Snapshot")
 qs.Parameters("FisYear") = FisYear
 qs.Execute
 qs.Close

How do I re-write this? There are dozens of them in the whole project. I
know it might use CreateQueryDef but is there anything else besides
replacing that?

Is there a good location somewhere with a listing of all the old syntax and
how to replace it?  I'm sure this is just the beginning!

Is there any benefit to activating the DAO 2.5/3.51 compatibility Library?

Thanks!
Jackie
JGawlik - 10 Feb 2008 01:25 GMT
I found somewhere that I had to replace OpenqueryDef with QueryDefs in my
example.  Now I get:
Method or data member not found on the rs.CLNT_MATT_CODE line.

 Do Until rs.EOF
   If rs.CLNT_MATT_CODE = "99912.00001" Then  ' vacation
     MtdVc = rs(PeriodStr)
     YtdVc = rs("Total")
   End If

I assume there is something wrong with one of the lines here.  Some more
obsolete syntax?
 Dim db As Database
 Dim rs As Recordset
 Dim qs As QueryDef
 Dim PeriodStr As String

 Set db = DBEngine(0)(0)
 Set qs = db.QueryDefs("qry rpt at10 days out")
 qs.Parameters("EmplUno") = [EmplUno]
 qs.Parameters("FisYear") = FisYear
 qs.Parameters("Period") = Period
 Set rs = qs.OpenRecordset()

>I have been called to convert an old Access 97 database to Access 2003.  I
>haven't worked in Access for a long time and would appreciate a push in the
[quoted text clipped - 19 lines]
> Thanks!
> Jackie
Albert D. Kallal - 11 Feb 2008 08:59 GMT
> Set qs = db.OpenQueryDef("qryAppend Billed_Fees Snapshot")
>  qs.Parameters("FisYear") = FisYear
>  qs.Execute
>  qs.Close

Also, are you sure the above code is correct?

it should read:

  set qs = db.QueryDefs("qryAppend Billed_Fees Snapshot")

Did this code compile in a97 before you converted?
(as a another hint, don't try and convert something with compile
errors...make sure it compiles BEFORE you do the conversion from a97 to
a2003.

Signature

Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.