UltraLite for MobileVB User's Guide
UltraLite for MobileVB API Reference
ULDatabaseManager class
CreateDatabase creates a new database and returns a connection to it.
CreateDatabase( parms As String ) As ULConnection
Member of UltraLiteAFLib.ULDatabaseManager
Creates a new database and returns a connection to it. It fails if the specified database already exists. A valid schema file must be specified to successfully create a database. To alter the schema of an existing database, use the ULDatabaseSchema ApplyFile method.
CautionOnly one database may be active at a given time. Attempts to create a different database while other connections are open will result in an error. |
For more information about ApplyFile, see ULDatabaseSchema class and ApplyFile method.
parms A semicolon-separated list of database creation parameters.
Note for VFS card for Palm usersThe Palm_fs=vfs parameter needs to be specified both for CreateDatabase and OpenConnection methods if you want to have the database reside on the virtual file system. |
For information about connection parameters, see Connection Parameters.
For more information about the Palm_fs parameter, see palm_fs parameter .
Returns a connection to a newly created UltraLite database.
The following code creates a ULDatabaseManager object. This is the first object you create when writing for UltraLite for MobileVB. Note that CreateDatabase requires that no .udb file exists, and OpenConnection is used when a .udb file already exists.
Dim conn_parms As String
Dim open_parms As String
Dim schema_parms As String
conn_parms = "uid=DBA;pwd=SQL"
open_parms = conn_parms & ";" & _
"PALM_DB=Syb3;file_name=c:\tutorial\tutCustomer.udb"
schema_parms = open_parms & ";" & _
"PALM_SCHEMA=tutCustomer;" & _
"schema_file=c:\tutorial\tutCustomer.usm"
On Error Resume Next
Set Connection = DatabaseMgr.OpenConnection(open_parms)
If Err.Number = _
ULSQLCode.ulSQLE_DATABASE_NOT_FOUND _
Then
Err.Clear
Set Connection = _
DatabaseMgr.CreateDatabase(schema_parms)
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End IfFor information about connection parameters, see OpenConnection method.