//************************************************************// // 函数名: // // 功能: 主要是根据传入的库文件名,自动完成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 |
关于动态注册ASA数据库ODBC数据源
最新推荐文章于 2016-12-02 10:18:00 发布