Home > database >  Pb generated EXE, how to sign up to create local data source? No pb environment cannot run
Pb generated EXE, how to sign up to create local data source? No pb environment cannot run

Time:09-18

CodePudding user response:

The problem is from pb environment, must use pb create the data source to run normally, a great god came to help

CodePudding user response:


Didn't have what problem, give some ideas, run offline DLL should be match well, how to automatically create the data source?
How to run in the absence of pb environment can connect to the database file, is at the bottom right desktop icon will display red, that has good database connection

CodePudding user response:

About this to dynamically register ASA database ODBC data source

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//function name is://
//function, mainly according to the incoming library file name, completion of ODBC configuration//
//a file name registered in the ODBC data source//
//input://
//ls_filename file name (mainly the library files)//
//ls_dir files in the directory//
//the return value://
//1 said automatic configuration success//
//0 means automatic configuration failure//
//designers: Adamswater//
//completion time: in October 2003,//
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
The integer li_return//the return value
String ls_filename
The integer li_rtn
String ls_root
String ls_root_table

Ls_filename=as_filename + "db"//get the database file name


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 the if
Li_rtn=registryset (ls_root_table, AutoStop, regstring! , "Yes")
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (ls_root_table, "Compress", regstring! , "NO")
If li_rtn=1 then
Return 0
End the if
Li_rtn=registryset (ls_root_table, "DatabaseFile", regstring! , as_dir + "" + ls_filename)
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (regstring ls_root_table, "DatabaseName"! , as_filename)
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (ls_root_table, "Debug", regstring! , "NO")
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (ls_root_table, "DisableMultiRowFetch", regstring! , "NO")
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (ls_root_table, "Driver", regstring! , as_dir + "" + "dbodbc8. DLL")
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (ls_root_table, "Start", regstring! , as_dir + "" + "dbeng8. Exe - d - c8m")
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (ls_root_table, "EngineName", regstring! , "NDJWGLXT")
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (ls_root_table, "Integrated", regstring! , "No")
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (regstring ls_root_table, "PWD"! , "JWGLXT")
If li_rtn=1 then
Li_return=0
End the if
Li_rtn=registryset (regstring ls_root_table, "UID"! , "JWGLXT")
If li_rtn=1 then
Li_return=0
End the if
Return li_return

CodePudding user response:

The function definitions
/* function name f_odbc_autoreg
Function will copy the database to register under the winsystem32
Function parameters: mydb_name will register the database name:
Applicable scope pb9.0 sqlanywhere9.0 database
Practical considerations: need to install the sqlanywhere9.0 support drive to the system directory
Problem: after running pb9.0 cannot generate a new database, to be solved
2006-11 have solve the problem of setting parameters are case sensitive. */


Constant long lensize=260
String STR
STR=Space (lensize)
GetSystemDirectory (STR, lensize)
/////////automatically set the odbc
Int answer1, answer2 answer3 answer4, answer5, answer6, answer7, answer8, answer9, ing1, ing2, ing3, ing4, tag1, tag2, tag3
String ls_driver ls_trans, app_path db_path, db_start, ins1, ins2, ins3, ins4, tags1, tags2, tags3
App_path=STR
////////SET the ODBC/ODBCIST INI/ODBC DRVIER
Ls_driver=app_path + '/DBODBC9. DLL'
Ls_trans=app_path + '/DBODTR9. DLL'
Tag1=RegistryGet (' HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST INI/ODBC Drivers', 'the Adaptive Server Anywhere 9.0, RegString! , tags1)
If tag1=1 then
Answer1=RegistrySet (' HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST INI/ODBC Drivers', 'the Adaptive Server Anywhere 9.0, RegString! , 'Installed')
End the if
If answer1=1 then

The return - 1
End the if
////////////
Ing1=RegistryGet (' HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST INI/the Adaptive Server Anywhere 9.0 ', 'Driver', RegString! Ins1)
Ing2=RegistryGet (' HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST INI/the Adaptive Server Anywhere 9.0 ', 'Setup' RegString! , ins2)
If ing1=1 or ing2=1 then
Answer2=RegistrySet (' HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST INI/the Adaptive Server Anywhere 9.0 ', 'Driver', RegString! , ls_driver)
Answer3=RegistrySet (' HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST INI/the Adaptive Server Anywhere 9.0 ', 'Setup' RegString! , ls_driver)
If answer2=1 or answer3=1 then
The return - 1
End the if
End the if
///////the above part does not have the database data

Tag3=RegistryGet (' HKEY_CURRENT_USER/SOFTWARE/ODBC/ODBC.ini/ODBC data Sources, ', & amp;
Mydb_name RegString! , tags3)
If tag3=1 then
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related