在PB中自动注册Adaptive Server Anywhere 8.0 ODBC数据源

以下函数是用来在PB中自动注册Adaptive Server Anywhere 8.0 ODBC的数据源

//====================================================================
// 函数: of_reganywhereodbc()
//--------------------------------------------------------------------
// 说明: 注册Adaptive Server Anywhere 8.0 ODBC数据源
//--------------------------------------------------------------------
// 参数:
//  value string as_DatabaseFile  
//  value string as_databasename  
//--------------------------------------------------------------------
// 返回值:  integer
//--------------------------------------------------------------------
// 设计人: EVEREST  日期: 2005.10.28
//--------------------------------------------------------------------
// 历史修改:
//====================================================================

width="468" height="60" frameborder="0" align="middle" border="0" marginheight="1" marginwidth="1" src="http://b199.cn/blog_ads/Google_468_60.htm" name="I1">


If as_DatabaseFile = "" Or IsNull(as_DatabaseFile) Or as_databasename = "" Or IsNull(as_databasename) Then Return -1

String ls_isregister,ls_currentdir
ls_currentdir = GetCurrentDirectory()

RegistryGet("HKEY_LOCAL_MACHINE/Software/ODBC/ODBCINST.INI/ODBC Drivers","Adaptive Server Anywhere 8.0", ls_isregister)

//If ls_isregister = '' Or IsNull(ls_isregister) Then //注册数据驱动
    RegistrySet("HKEY_LOCAL_MACHINE/Software/ODBC/ODBCINST.INI/ODBC Drivers","Adaptive Server Anywhere 8.0","Installed")
    RegistrySet("HKEY_LOCAL_MACHINE/Software/ODBC/ODBCINST.INI/Adaptive Server Anywhere 8.0", "Driver",ls_currentdir + "/sqlanywhere/drv/dbodbc8.dll")
    RegistrySet("HKEY_LOCAL_MACHINE/Software/ODBC/ODBCINST.INI/Adaptive Server Anywhere 8.0", "Setup",ls_currentdir + "/sqlanywhere/drv/dbodbc8.dll")
    RegistrySet("HKEY_LOCAL_MACHINE/Software/ODBC/ODBCINST.INI/Adaptive Server Anywhere 8.0 Translator","Driver" ,ls_currentdir + "/sqlanywhere/drv/dblgen8.dll")
    RegistrySet("HKEY_LOCAL_MACHINE/Software/ODBC/ODBCINST.INI/Adaptive Server Anywhere 8.0 Translator","Setup" ,ls_currentdir + "/sqlanywhere/drv/dblgen8.dll")
//End If

<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">; </script>

SetNull(ls_isregister)
RegistryGet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/ODBC Data Sources", as_databasename,ls_isregister)
//If ls_isregister = '' Or IsNull(ls_isregister) Then //注册数据源
    RegistrySet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/ODBC Data Sources", as_databasename,'Adaptive Server Anywhere 8.0')
    RegistrySet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/"+as_databasename,"AutoStop",'yes')
    RegistrySet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/"+as_databasename,"DatabaseFile", as_databasefile)
    RegistrySet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/"+as_databasename,"DatabaseName", as_databasename)
    RegistrySet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/"+as_databasename,"Description", as_databasename)
    RegistrySet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/"+as_databasename,"Driver",ls_currentdir + '/sqlanywhere/drv/dbodbc8.dll')
    RegistrySet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/"+as_databasename,"PWD", 'sql')
    RegistrySet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/"+as_databasename,"Start", ls_currentdir + '/sqlanywhere/drv/dbeng8.exe  -c 8m -m')
    RegistrySet("HKEY_CURRENT_USER/Software/ODBC/ODBC.INI/"+as_databasename,"UID", 'dba')
 
//End If
Return 1
 

width="468" height="60" frameborder="0" align="middle" border="0" marginheight="1" marginwidth="1" src="http://b199.cn/blog_ads/Google_468_60.htm" name="I1">

  • 0
    点赞
  • 1
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

打赏
文章很值,打赏犒劳作者一下
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页

打赏

Everest

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者