當前位置:編程學習大全網 - 編程語言 - Powerbuilder 10.0應用程序發布及動態配置ODBC

Powerbuilder 10.0應用程序發布及動態配置ODBC

 Powerbuilder編制的程序打包分為兩部分 動態庫文件及配置ODBC數據源

  ?壹 動態庫文件

 由PB 自帶的打包工具:PowerBuilder Runtime Packager 在Database? Interfaces選項中?選擇

ODBC Database Driver(ODB) Sybase Adaptive Server Enterprise(SYC)?

 便可生成程序所需要的動態庫安裝程序包 然後將程序包中的文件復制到程序目錄中即可

int RunCountsRunCounts=profileint( TheOneRun ini RunFlag GetRunFlag )string GetNowPathGetNowPath = GetCurrentDirectory( )String DataBasePathDataBasePath=GetNowPath+ \phonebook_database db String DataBasePath_dll_ DataBasePath_dll_ DataBasePath_dll_ =GetNowPath+ \dbodbc DLL DataBasePath_dll_ =GetNowPath+ \dbeng exe if RunCounts= then RegistrySet( HKEY_LOCAL_MACHINE\Sofare\ODBC\ODBCINST INI\ODBC Drivers Adaptive Server Anywhere RegString! Installed ) RegistrySet( HKEY_LOCAL_MACHINE\SOFARE\ODBC\ODBCINST INI\ODBC Translators Adaptive Server Anywhere Translator RegString! Installed )RegistrySet( HKEY_LOCAL_MACHINE\Sofare\ODBC\ODBCINST INI\Adaptive Server Anywhere Driver RegString! DataBasePath_dll_ ) RegistrySet( HKEY_LOCAL_MACHINE\Sofare\ODBC\ODBCINST INI\Adaptive Server Anywhere Setup RegString! DataBasePath_dll_ ) RegistrySet( HKEY_LOCAL_MACHINE\Sofare\ODBC\ODBCINST INI\ODBC Data Sources phonebook_database RegString! Adaptive Server Anywhere ) registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\odbc data sources phonebook_database regstring! Adaptive Server Anywhere )registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\phonebook_database driver regstring! DataBasePath_dll_ )registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\phonebook_database start RegString! DataBasePath_dll_ )registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\phonebook_database uid regstring! dba )registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\phonebook_database pwd regstring! sql )registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\phonebook_database databasename regstring! phonebook_database )registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\phonebook_database databasefile regstring! DataBasePath)registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\phonebook_database autostop regstring! yes )registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\phonebook_database Integrated regstring! no )registryset( HKEY_CURRENT_USER\sofare\odbc\odbc ini\phonebook_database Description regstring! phonebook_database )setprofilestring( TheOneRun ini RunFlag GetRunFlag )end ifSQLCA DBMS = ODBC SQLCA AutoCommit =falseSQLCA database=DataBasePathSQLCA DBParm = Connectstring= DSN=phonebook_database;uid=dba;pwd=sql CONNECT USING SQLCA;if sqlca sqlcode <> Then messagebox( 數據庫連接失敗 請重啟程序 Question! Ok!) setprofilestring( TheOneRun ini RunFlag GetRunFlag )close(主窗體名)Else open(主窗體名) lishixinzhi/Article/program/PB/201311/24560

  • 上一篇:中國林業科學研究院的機構設置
  • 下一篇:12寸新MacBook運行Windows是怎樣的體驗
  • copyright 2024編程學習大全網