anywhere 11:
String ls_dbFile, ls_OrgID, ls_AppPath
ls_AppPath = Space(144)
if GetCurrentDirectoryA(144, ls_apppath)>0 then ls_apppath=trim(ls_apppath)
gs_apppath = ls_apppath
ls_dbfile=".\DB\*.db"
If Lower(ls_dbFile) = Lower(ls_AppPath + '\DB\*.db') Then Return
RegistrySet(gs_KeyODBC, 'Autostop', 'Yes')
RegistrySet(gs_KeyODBC, 'DatabaseName', '*')
RegistrySet(gs_KeyODBC, 'DatabaseFile', ls_AppPath + '\DB\*.db')
RegistrySet(gs_KeyODBC, 'UID', 'dba')
RegistrySet(gs_KeyODBC, 'PWD', 'sql')
RegistrySet(gs_KeyODBC, 'Driver', ls_AppPath + '\DB\dbodbc11.dll')
RegistrySet(gs_KeyODBC, 'Start', ls_AppPath + '\DB\dbeng11.exe -Q')
其中:
global variables:
Constant String gs_KeyODBC = 'HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.IN\*'
global external functions:
Function ulong GetCurrentDirectoryA (ulong textlen, ref string dirtext) library "KERNEL32.DLL" alias for "GetCurrentDirectoryA;Ansi"
*代表数据源名称,#代表odbc名称.
当然,还必不可少相关动态库.
阅读(3328) | 评论(1) | 转发(0) |