| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 509 人关注过本帖
标题:怎么找 pbl 中连接的数据库连接密码和用户
只看楼主 加入收藏
Chivas
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2014-5-11
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
怎么找 pbl 中连接的数据库连接密码和用户
源代码:



string ls_dbms
string ls_database
string ls_logid
string ls_logpass
string ls_servername
string ls_dbparm
string ls_pass
string ls_computername
integer i
integer li_len
string ls_isdbencrypt
string ls_pcid



if registryget("HKEY_LOCAL_MACHINE\Software\Abacus\POS10\Database","DBMS",regstring!,ls_dbms) <> 1 then
    messagebox("错误,","尚未设置数据库连接,请检查注册表设置!")
    halt close
end if

registryget("HKEY_LOCAL_MACHINE\Software\Abacus\POS10\Database","Database",regstring!,ls_database)
registryget("HKEY_LOCAL_MACHINE\Software\Abacus\POS10\Database","ServerName",regstring!,ls_servername)
registryget("HKEY_LOCAL_MACHINE\Software\Abacus\POS10\Database","logid",regstring!,ls_logid)
registryget("HKEY_LOCAL_MACHINE\Software\Abacus\POS10\Database","logpass",regstring!,ls_logpass)
registryget("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName",regstring!,ls_computername)
registryget("HKEY_LOCAL_MACHINE\Software\Abacus\POS10\Database","IsDBEncrypt",regstring!,ls_isdbencrypt)

if ls_pcid = "" then
    registryget("HKEY_LOCAL_MACHINE\Software\Abacus\POS10\Database","stationid",regstring!,ls_pcid)
end if

if ls_pcid <> ls_computername then
    ls_pcid = ls_computername
    registryset("HKEY_LOCAL_MACHINE\Software\Abacus\POS10\Database","stationid",regstring!,ls_pcid)
end if

if isnull(ls_isdbencrypt) or trim(ls_isdbencrypt) = "" then
    ls_isdbencrypt = "n"
end if

if ls_isdbencrypt = "y" then
    li_len = len(ls_logpass)

    for i = 1 to li_len

        if mod(i,2) = 0 then
            ls_pass = ls_pass + char(255 - asc(mid(ls_logpass,i,1)))
        else
            ls_pass = ls_pass + char(256 - asc(mid(ls_logpass,i,1)))
        end if

    next

else
    ls_pass = ls_logpass
end if

if ls_dbms = "ODBC" or ls_dbms = "odbc" then
    registryget("HKEY_LOCAL_MACHINE\Software\Abacus\POS10\Database","DBParm",regstring!,ls_dbparm)
    atr_in.dbms = "ODBC"
    atr_in.autocommit = false
    atr_in.dbparm = ls_dbparm
else
    atr_in.dbms = ls_dbms
    atr_in.database = ls_database
    atr_in.servername = ls_servername
    atr_in.logid = ls_logid
    atr_in.logpass = ls_pass
    atr_in.autocommit = false
    atr_in.dbparm = "Host = '" + ls_pcid + "'"
end if

connect using atr_in;

if atr_in.sqlcode <> 0 then
    messagebox("数据库连接失败!",atr_in.sqlerrtext)
    halt close
end if


1.开发人员数据库连接的密码是写在注册表里面吗?
2.访问的注册表是本地的注册表还是数据库的注册表?
搜索更多相关主题的帖子: 数据库连接 Software 源代码 注册表 密码 
2014-05-11 16:39
tlliqi
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:204
帖 子:15453
专家分:65956
注 册:2006-4-27
收藏
得分:20 
不懂
2014-05-12 13:41
快速回复:怎么找 pbl 中连接的数据库连接密码和用户
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016112 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved