关于动态注册ASA数据库ODBC数据源

//************************************************************//
//   函数名:   //  
//   功能:   主要是根据传入的库文件名,自动完成ODBC的配置   //
//   一文件名在ODBC中注册数据源   //
//   输入:   //  
//   ls_filename   文件名称(主要是库文件)   //
//   ls_dir   文件所在的目录   //
//   返回值:   //
//   1   表示自动配置成功   //
//   0   表示自动配置失败   //
//   设计者:   Adamswater   //
//   完成时间:   2003年10月   //
//************************************************************//
integer   li_return   //返回值
string   ls_filename
integer   li_rtn
string   ls_root
string   ls_root_table

ls_filename   =   as_filename   +   ".db "//获得数据库文件名字


ls_root   =   "HKEY_LOCAL_MACHINE/software/odbc/odbc.ini "
ls_root_table   =   ls_root   +   "/ "   +   as_filename
li_return   =   1
li_rtn   =   registryset(ls_root,as_filename,regstring!, " ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "AutoStop ",regstring!, "Yes ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "Compress ",regstring!, "NO ")
if   li_rtn=   -   1   then
return   0
end   if
li_rtn   =   registryset(ls_root_table, "DatabaseFile ",regstring!,as_dir   +   "/ "+ls_filename)
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "DatabaseName ",regstring!,as_filename)
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "Debug ",regstring!, "NO ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "DisableMultiRowFetch ",regstring!, "NO ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "Driver ",regstring!,as_dir   +   "/ "+ "dbodbc8.dll ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "Start ",regstring!,as_dir   +   "/ "+ "dbeng8.exe   -d   -c8m ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "EngineName ",regstring!, "ndjwglxt ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "Integrated ",regstring!, "No ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "PWD ",regstring!, "jwglxt ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
li_rtn   =   registryset(ls_root_table, "UID ",regstring!, "jwglxt ")
if   li_rtn=   -   1   then
li_return   =   0
end   if
return   li_return    
转自:http://topic.csdn.net/u/20070405/16/d9fbddda-393c-4e65-9d01-51376e511c78.html
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值