Database.Connect
From Real Software Documentation
Method
Connects to the database server and opens the database for access.
Before proceeding with database operations, test to be sure that Connect returns True.
Example
The following is in the App.Open of the Orders example database that is in the Examples folder that ships with Real Studio. It establishes a connection with the database, if it exists.
if OrdersDB.databaseFile.exists = true then
// The database file already exists, so we want to connect to it.
if OrdersDB.Connect() = false then
DisplayDatabaseError( false )// there was an error connecting to the database
Quit
return
end if
else
// The database file does not exist so we want to create a new one.
// The process of creating a database will establish a connection to it
// so there isn't a need to call Database.Connect after we create it.
CreateDatabaseFile
end
// The database file already exists, so we want to connect to it.
if OrdersDB.Connect() = false then
DisplayDatabaseError( false )// there was an error connecting to the database
Quit
return
end if
else
// The database file does not exist so we want to create a new one.
// The process of creating a database will establish a connection to it
// so there isn't a need to call Database.Connect after we create it.
CreateDatabaseFile
end
