Use Windows.pkg Use DFClient.pkg Use SQL\cSQLNET.pkg Use cDescription.pkg Activate_View Activate_oTestsql for oTestsql Object oTestsql is a dbView Set Border_Style to Border_Thick Set Size to 200 300 Set Location to 2 2 Set pbAutoActivate to True Object oSQL is a cSQLNET End_Object Object oButton1 is a Button Set Size to 14 83 Set Location to 47 95 Set Label to "Opret Database" // fires when the button is clicked Procedure OnClick Send OpretDatabase End_Procedure End_Object Object oButton2 is a Button Set Size to 14 65 Set Location to 82 97 Set Label to "Opret tabel" // fires when the button is clicked Procedure OnClick Send OpretTabel End_Procedure End_Object Object oButton3 is a Button Set Size to 14 90 Set Location to 109 97 Set Label to "Kopier struktur" // fires when the button is clicked Procedure OnClick Send KopierStruktur End_Procedure End_Object Procedure OpretDatabase Boolean bOk Send ServerConnection of oSQL "AKE\SQLEXPRESSAKE" "" "" "" True Get ExecuteQuery of oSQL "CREATE DATABASE Novax" to bOk End_Procedure Procedure OpretTabel Boolean bOk Send ServerConnection of oSQL "AKE\SQLEXPRESSAKE" "Novax" "" "" True Get ExecuteQuery of oSQL "DROP TABLE Test" to bOk Get ExecuteQuery of oSQL "CREATE TABLE Test(RECNUM int IDENTITY)" to bOk Get ExecuteQuery of oSQL "CREATE UNIQUE INDEX Test000 on Test (RECNUM)" to bOk Send OpretINT End_Procedure Procedure OpretINT Integer iFilnr Get Seq_New_Channel to iFilnr Direct_Output channel iFilnr "d:\Udvk171\dbUpdateUtil\Data\Test.int" Writeln channel iFilnr "DRIVER_NAME MSSQLDRV" Writeln channel iFilnr "SERVER_NAME SERVER=(local);Trusted_Connection=yes;DATABASE=Novax" Writeln channel iFilnr "DATABASE_NAME Test" Writeln channel iFilnr "SCHEMA_NAME dbo" Writeln channel iFilnr "RECNUM_TABLE YES" Writeln channel iFilnr "TABLE_CHARACTER_FORMAT Ansi" Writeln channel iFilnr "PRIMARY_INDEX 0" Writeln channel iFilnr "INDEX_NUMBER 0" Writeln channel iFilnr "INDEX_NAME Test000" Close_Output channel iFilnr Send Seq_Release_Channel iFilnr End_Procedure Procedure KopierStruktur Handle hDescription Integer iSrcFile // Lav beskrivelsesfiler. Move 0 to iSrcFile Get_Attribute DF_FILE_NEXT_EMPTY of iSrcFile to iSrcFile Open "d:\Udvk171\dbUpdateUtil\Data\novax12.dat" as iSrcFile Get Create (RefClass(cDescription)) to hDescription Set psDescriptionDir of hDescription to "d:\Udvk171\dbUpdateUtil\Desc" Send DoDescribeFile of hDescription iSrcFile "Test" Send Destroy of hDescription Close iSrcFile // Kopier strukturen. Send DoLoadDescriptionfiles of Update_vw "Test" "d:\Udvk171\dbUpdateUtil\Desc\" Send DoLoadKnownIssues of Update_vw "Test" "d:\Udvk171\dbUpdateUtil\Desc\" Send DoUpdateDatabasefile of Update_vw "Test" "d:\Udvk171\dbUpdateUtil\Data\Test.int" End_Procedure End_Object