Basically, a class defines some data elements and the methods (sub-routines) that manipulate that data.
In the case of a database, the methods are Forms, Reports, Queries, and other non-data pieces of the application. Typically, these methods read, write, print, and display the data stored in the tables.
The Tables are the class data definitions - each table is like a variable length array of related data. However, classes never store data, they just define its structure.
An object is an instance of a class. Only the object actually stores data, the class just defines how the data is stored. If several objects exist, each one has its own data, but there is only one copy of the methods.
There are significant differences between Paradox and MS Access. The following comments assume that froms and reports are developed on a separate development system and then delivered to the live system. (Never ever develop software on the live system.)
Paradox | Uses an alias to access tables.
Since these aliases can be re-defined programmatically,
they can be used as object pointers.
Since each database is implemented as a subdirectory, updating a method is as simple as copying a file to the directory. |
MS Access | ODBC pointers can be used to access any table EXCEPT
MS Access tables. Must use OpenDatabase
to connect to a database via code.
In Forms, the Record Source property can only be a
Table or a Query.
Since each database is implemented as an mdb file, there is no way to copy a single method to an existing design. As a result, you need to replace the entire mdb file. If the data and methods where in the same file, this could never be done. |
Paradox
"Temp DocRef Old" "Temp DocRef Main" "Temp DocRef Compare" "Temp DocRef Friends" "Temp DocRef Root"Typically, these are re-defined before each Method is called.
method Add_Aliases() Logical ; Assign aliases used by forms, reports, and queries var DirStr String BasicPathStr String tempStr String endVar BasicPathStr = getAliasPath("Reference Documents") + "\\" + globalParameters["Relative Path"] DirStr = Document_UI_Field.Get_Document_Directory() tempStr = BasicPathStr + "\\" + globalParameters["Old Version"] + "\\" + DirStr if globalParameters["Old Version"] <> "" then if not Add_One_Alias("Temp DocRef Old", tempStr) then return False endif endif tempStr = BasicPathStr + "\\" + globalParameters["Current Version"] + "\\" + DirStr if not Add_One_Alias("Temp DocRef Main", tempStr) then return False endif tempStr = BasicPathStr + "\\" + globalParameters["Current Version"] + "\\compare" if not Add_One_Alias("Temp DocRef Compare", tempStr) then return False endif tempStr = BasicPathStr + "\\" + globalParameters["Current Version"] + "\\friends" if not Add_One_Alias("Temp DocRef Friends", tempStr) then return False endif if not Add_One_Alias("Temp DocRef Root", BasicPathStr) then return False endif return True endmethod Add_Aliases method Add_One_Alias(const AliasStr String, const DirectoryStr String) Logical var tempStr String endvar ; If the alias is already defined, don't do it again ; This will allow the form to work when other objects ; (reports, forms, queries ...) are open ; using the same alias definitions tempStr = getAliasPath(AliasStr) if tempStr = upper(DirectoryStr) then return True endif if not addAlias(AliasStr, "Standard", DirectoryStr) then msginfo(string("Alias \":", AliasStr, ":\" in use"), "You must close the existing form before " + "requesting a new one.\n\n" + DirectoryStr) return False endif return True endmethod Add_One_AliasAuthor: Robert Clemenzi - clemenzi@cpcug.org