Modifying tables

jda jda at his.com
Sun Nov 23 11:58:43 CST 2003


>     i = localFormatDB.SQLExecute("ALTER table example ADD user3 string(20)")
>     i = localFormatDB.SQLExecute("ALTER table example ADD user3style Blob(1)")
>     i = localFormatDB.SQLExecute("ALTER table example ADD user4 String(20)")
>     i = localFormatDB.SQLExecute("ALTER table example ADD user4style Blob(1)")
>     myCursor = new VCursor(localFormatDB, "select * from example
>  where recID = 1", kServer, kReadWrite)
>     if myCursor <> nil then
>       myCursor.Field("user3").SetString("user3 information")
>       myCursor.Field("user4").setString("user4 information")
>
>       result = myCursor.update
>       myCursor = nil
>    end if
>

>First of all you need pay attention on property
>
>     Vdatabase.SchemaVersion.
>
>It is good idea in your open db function add code that check it,
>If its version is 1 then
>         open db
>         modify structure
>         change schemaversion to 2
>         close db
>
>open it again as version 2 db.

I did that...still no luck.

>
>
>2) you DO NOT use classes in your project ?
>

Yes, I do. What does that have to do with modifying tables?

Jon


More information about the Valentina mailing list