UltraLite ActiveX User's Guide
Understanding UltraLite ActiveX Development
Working with UltraLite databases
To modify your existing database structure, use the ApplyFile or ApplyFileWithParms method. In most cases there will be no data loss, but data loss can occur if columns are deleted or if the data type for a column is changed to an incompatible type.
For more information about these methods, see ApplyFile method and ApplyFileWithParms method.
The following code fragment connects to a database and applies a new schema file using the ApplyFile method.
For more information about connecting to a database, see Connecting to an UltraLite database.
' eMbedded Visual Basic Dim db As ULDatabaseManager Dim conn As ULConnection Set db = CreateObject("UltraLite.ULDatabaseManager") Set conn = db.OpenConnection("dbf = \My Documents\mydb.udb") if ( conn.Schema.TableCount = 0 ) then conn.Schema.ApplyFile("\My Documents\myschema.usm") end if
// JScript var db; var conn; db = new ActiveXObject("UltraLite.ULDatabaseManager"); conn = db.OpenConnection("dbf = \\My Documents\\mydb.udb"); if ( conn.Schema.TableCount == 0 ) { conn.Schema.ApplyFile("\\My Documents\\myschema.usm"); }