Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Description of handling PmDatabase object when no table exists

If a database table doesn't exist, it can be created by the methods PmDatabase.Create,...

Caution! - these methods are not functional over the table accessed by ODBC.

If working with non-existing table (or non-existing database) the PmDatabase object must be closed for example by the PmDatabase.Close method (methods PmDatabase.Open,... cannot be used and also the On start configurator must be set on value Don't connect the database and don't open the table or it is necessary to close the table and the database by the PmDatabase.Close method before calling the PmDatabase.Create method).

Example:
Let's have established an object of the PmDatabase type in the PmRoot with the name "Database". An example of creating a table in the database
Dim oDb
Set oDb = pMe.Pm("/Database")
oDb.Create
oDb.CreateField "columnText", pmcDbFldText, 180
oDb.CreateField "columnBool", pmcDbFldBoolean, 0
oDb.CreateField "columnReal", pmcDbFldSingle, 0
oDb.CreateField "columnTime", pmcDbFldDate, 0

Thus created table can be treated in a standard way.

For the basic walkthroughs with the PmDatabase object see the set of examples in the \Pm\Examples\AppExamples\AppExamples folder.

© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice