- Local time
- Today, 12:45
- Joined
- Feb 19, 2002
- Messages
- 46,981
Don't confuse filters with the WhereCondition of the OpenForm and OpenReport methods. In the case of the WhereCondition, the criteria is merged into the RecordSource query and passed through to the server. This is not the case with filters. Filters are applied locally to an already created recordset. Notice when you use a filter, you see the word filtered in the navigation bar. This indicates that you are only viewing some of the available records whereas when you use the WhereCondition, you are viewing ALL the available records.
I have been using relational databases since the early 80's and IMNSHO there are only two valid reasons for using embedded SQL.
1. The query is truely dynamic and the criteria or select clause change at runtime.
2. The selection criteria needs to use a UDF or VBA function that is not available on the server and by using dynamic SQL, I take the hit of binding rather than having Jet retrieve an entire table or worse because it needs to apply my criteria locally.
In reality the performance hit for dynamic SQL is not the real issue. The real issue is the bloat that occurs because Jet needs to create an access plan each time a query is executed. People who use dynamic SQL invariably need to use the compact on close option for their databases in order to keep the app from blowing up to an unmanageable size. I also personally find the use of embedded SQL annoying because I can't play with it as I can with the SQL in a querydef and I can't run it outside of the context of the app for testing. And finally, what masochist wants to type all those data names when you can use the QBE and point and click. In the years between 1982 when I first started using DB2 and 1993 when I first discovered Access, my biggest dream was a tool like the QBE to save me from all the typing I needed to do to write SQL strings in my COBOL programs.
Queries should either be stored as querydefs (preferred) or used as strings in the RecordSource or RowSource properties of forms/reports and list/comboboxes. When used as RecordSources of forms/reports, they should take criteria to limit the rows returned or the WhereCondition must be used when the form/report is opened. If this is not done when converting a Jet application to ODBC, it is quite likely that the ODBC version of the application will end up slower than the Jet version.
The .adp was never widely adoped for several reasons. The two most important being that the .adp was Access but it wasn't the same as anything you did with an .mdb. Converting from an .mdb to an .adp was a nightmare and there was no tool to go the other way. The other reason was that the .adp allowed linking to only SQL Server tables. it couldn't even link to Jet tables!!! let alone DB2, Oracle, or Sybase which seriously reduced its usefulness in a corporate environment. In fact, the first Access application I developed linked to DB2 tables rather than Jet tables. I was hooked
I have been using relational databases since the early 80's and IMNSHO there are only two valid reasons for using embedded SQL.
1. The query is truely dynamic and the criteria or select clause change at runtime.
2. The selection criteria needs to use a UDF or VBA function that is not available on the server and by using dynamic SQL, I take the hit of binding rather than having Jet retrieve an entire table or worse because it needs to apply my criteria locally.
In reality the performance hit for dynamic SQL is not the real issue. The real issue is the bloat that occurs because Jet needs to create an access plan each time a query is executed. People who use dynamic SQL invariably need to use the compact on close option for their databases in order to keep the app from blowing up to an unmanageable size. I also personally find the use of embedded SQL annoying because I can't play with it as I can with the SQL in a querydef and I can't run it outside of the context of the app for testing. And finally, what masochist wants to type all those data names when you can use the QBE and point and click. In the years between 1982 when I first started using DB2 and 1993 when I first discovered Access, my biggest dream was a tool like the QBE to save me from all the typing I needed to do to write SQL strings in my COBOL programs.
Queries should either be stored as querydefs (preferred) or used as strings in the RecordSource or RowSource properties of forms/reports and list/comboboxes. When used as RecordSources of forms/reports, they should take criteria to limit the rows returned or the WhereCondition must be used when the form/report is opened. If this is not done when converting a Jet application to ODBC, it is quite likely that the ODBC version of the application will end up slower than the Jet version.
The .adp was never widely adoped for several reasons. The two most important being that the .adp was Access but it wasn't the same as anything you did with an .mdb. Converting from an .mdb to an .adp was a nightmare and there was no tool to go the other way. The other reason was that the .adp allowed linking to only SQL Server tables. it couldn't even link to Jet tables!!! let alone DB2, Oracle, or Sybase which seriously reduced its usefulness in a corporate environment. In fact, the first Access application I developed linked to DB2 tables rather than Jet tables. I was hooked
