国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

脫離開發主機在其他電腦里獨立運行PB程序

2024-07-21 02:09:53
字體:
來源:轉載
供稿:網友

我發現很多的同志不知道如何脫離自己的開發主機,在別人的計算機上獨立運行。其實很簡單,關鍵在于怎樣在注冊表中自動注冊你的asa數據源。
現在我把以前我發的帖子再發一次。希望對初學者有幫助!

大家用pb編好的程序,用安裝軟件(例如:installshile,installwais,creatinstall等)安裝打包后,在用戶機上一使用就出現數據庫沒有連接等問題,原因就是我們沒有在windows的注冊表中注冊我們的數據源。怎樣注冊呢?現在我來說一下:
首先我們用安裝軟件把我們的主運行文件要注冊到注冊表中的hkey_local_machine oftware/microsoft/windows/currentversion/app paths里,在這里我的主應用程序是idmis.exe,數據庫文件是wts.db。數據庫是pb8自帶的asa 7數據庫,原來的asa 5數據庫的文件和asa 7不一樣,要注意。

"注冊表注冊數據源"(w_regdatasorce)的open事件:
string ls_keyname
string ls_valuename
string ls_value
int li_a,li_a1,li_a2,li_a3,li_a4,li_a5,li_a6,li_a7
string ls_dbdriver,ls_dbstart,ls_dblocation,ls_wtslocation,ls_dbname,ls_db_dbeng7
//獲取本軟件的目錄,并保存在ls_location里
registryget("hkey_local_machine oftware/microsoft/windows/currentversion/app paths/idmis.exe","path",ls_wtslocation)
ls_dbdriver=ls_wtslocation+"/dbodbc7.dll"
ls_db_dbeng7=ls_wtslocation+"/dbeng7.exe"
ls_dbname=ls_wtslocation+"/wts.db"
ls_dbstart=ls_wtslocation+"/dbeng7.exe -d -c8m"
if not (fileexists(ls_dbdriver) and fileexists(ls_db_dbeng7)) then
 messagebox("錯誤!","沒有安裝sybase asa 7數據庫,或者沒有數據庫主控文件!",stopsign!)
 return
end if

//設置odbc/odbcinst.ini/odbc drivers
li_a=registryset("hkey_local_machine oftware/odbc/odbcinst.ini/odbc drivers", &
      +"sybase asa 7(函授學生信息查詢數據庫文件)", &
      +regstring!,"installed")
     
if li_a=-1 then
 messagebox("錯誤!","應用程序無法在注冊表中設置odbc drivers,請與作者聯系!",stopsign!)
 return
end if

//設置....odbc/odbcinst.ini
li_a1=registryset("hkey_local_machine oftware/odbc/odbcinst.ini ybase asa 7(函授學生信息查詢數據庫文件)", &
      +"cptimeout",regstring!,"not pooled")
     
li_a2=registryset("hkey_local_machine oftware/odbc/odbcinst.ini ybase asa 7(函授學生信息查詢數據庫文件)", &
      +"driver",regstring!,ls_dbdriver)
     
li_a3=registryset("hkey_local_machine oftware/odbc/odbcinst.ini ybase asa 7(函授學生信息查詢數據庫文件)", &
      +"setup",regstring!,ls_dbdriver)

if li_a1=-1 or li_a2=-1 or li_a3=-1 then
 messagebox("錯誤!","應用程序無法設置注冊表中odbcinst.ini,請與作者聯系!",stopsign!)
 return
end if

//設置odbc data source(odbc數據源),wts為數據源名稱
li_a=registryset("hkey_local_machine oftware/odbc/odbc.ini/odbc data sources", &
      +"wts",regstring!,"sybase asa 7(函授學生信息查詢數據庫文件)")
     
if li_a=-1 then
 messagebox("錯誤!","應用程序無法設置注冊表odbc data source,請與作者聯系!",stopsign!)
 return
end if

li_a=registryset('hkey_local_machine oftware/odbc/odbc.ini/wts','driver',regstring!,ls_dbdriver)
li_a1=registryset('hkey_local_machine oftware/odbc/odbc.ini/wts','start',regstring!,ls_dbstart)
li_a2=registryset('hkey_local_machine oftware/odbc/odbc.ini/wts','autostop',regstring!,'yes')
li_a3=registryset('hkey_local_machine oftware/odbc/odbc.ini/wts','databasefile',regstring!,ls_dbname)
li_a4=registryset('hkey_local_machine oftware/odbc/odbc.ini/wts','databasename',regstring!,'wts')
li_a5=registryset('hkey_local_machine oftware/odbc/odbc.ini/wts','enginename',regstring!,'函授學生信息查詢系統')
li_a6=registryset('hkey_local_machine oftware/odbc/odbc.ini/wts','pwd',regstring!,'sql')
li_a7=registryset('hkey_local_machine oftware/odbc/odbc.ini/wts','uid',regstring!,'dba')

if li_a=-1 or li_a2=-1 or li_a3=-1 or li_a4=-1 or li_a1=-1 or li_a5=-1  or li_a6=-1  or li_a7=-1  then
messagebox('錯誤','應用程序無法設置odbc.ini,系統將終止運行!',stopsign!)
return
end if

如果你要設置用戶級的odbc連接請對下面的鍵值進行設置:
置'hkey_current_user oftware/odbc/odbc.ini'
內容都是一樣的。看看自己windows中的odbc設置,有沒有變化??
好人作到底!我在付上脫離環境后所需的.dll文件:
pbvm8.dll  //pb虛擬機
pbdwe8.dll  //dw引擎
pbodb8.dll  //odbc配置文件
pbodb8.inf  //同上
dbodbc7.dll  //數據庫連接文件
dbeng7.exe  //數據庫啟動文件。如果你是網絡運行,那么就是dbserv7.exe
libjcc.dll  //我不知道  :-p
如果你有rich text對象控件,則: pbrtc.dll
如果你有ole對象,則:pbole7.dll

好了沒有,你成功了嗎??
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 大新县| 商南县| 昌平区| 永州市| 丰顺县| 临泽县| 松阳县| 宜春市| 华安县| 拜城县| 兴文县| 忻州市| 曲松县| 西乌珠穆沁旗| 饶河县| 宝山区| 定安县| 富蕴县| 资源县| 邵阳县| 阳高县| 城口县| 色达县| 东山县| 来安县| 瓮安县| 延长县| 博罗县| 武平县| 曲松县| 广东省| 德钦县| 木里| 合江县| 怀宁县| 包头市| 和硕县| 江口县| 长宁区| 合山市| 称多县|