Home > database >  Kneel down! Pb asa database connection problem
Kneel down! Pb asa database connection problem

Time:09-19

Ladies and gentlemen, consult a retarded question: how pb 9 with asa through special interface connection? Can give a code? Thank you master,

CodePudding user response:

May I have a look at the following ODBC, seems to have no direct without DSN
http://bbs.csdn.net/topics/390456326

CodePudding user response:

The
reference 1/f, xiajinxian response:
if there is no direct, can take a look at the following content no ODBC DSN
http://bbs.csdn.net/topics/390456326


This is made of ole db??

CodePudding user response:

Who can show code??

CodePudding user response:

refer to the second floor jiang396 response:
Quote: refer to 1st floor xiajinxian response:

May I have a look at the following ODBC, seems to have no direct without DSN
http://bbs.csdn.net/topics/390456326


This is made of ole db??


ODBC

CodePudding user response:

reference 4 floor xiajinxian response:
Quote: refer to the second floor jiang396 response:

Quote: refer to 1st floor xiajinxian response:

May I have a look at the following ODBC, seems to have no direct without DSN
http://bbs.csdn.net/topics/390456326


This is made of ole db??


ODBC


Is driven by registered function asa

CodePudding user response:

reference 5 floor jiang396 reply:
Quote: refer to 4th floor xiajinxian response:

Quote: refer to the second floor jiang396 response:

Quote: refer to 1st floor xiajinxian response:

May I have a look at the following ODBC, seems to have no direct without DSN
http://bbs.csdn.net/topics/390456326


This is made of ole db??


ODBC


Is driven by registered function asa.


Drivers are installed together with the client's

CodePudding user response:

Continue to look forward to...

CodePudding user response:

Let me give you a ready-made code

//by editing the registry automatically configure ODBC

The Integer li_FileNum, loops, I, i_database
Long flen, bytes_read new_pos
Blob, b tot_b

ULong ul_num
Int Answer, Answer1, Answer2 Answer3, Answer4, Answer5, Answer6, Answer7, Answer8, Answer9, ansApp
String ls_driver ls_start, ls_driver_yy ls_start_yy, ls_driver_xt, ls_start_xt, ls_driver_test

String ls_location, apppath db_path db_name, ODBCStr, ds_name, ls_dir, ls_dbfile

RegistryGet (" HKEY_LOCAL_MACHINE \ Software \ ODBC \ ODBCINST INI \ the Adaptive Server Anywhere 8.0 "and" Driver ", RegString! , ls_driver_test)
I_database=RegistryGet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ GGZB ", "DatabaseFile", RegString! , ls_dbfile)


//IF Mid (ls_driver_test, (Len (ls_driver_test) - 10), 11)='dbodbc8. DLL' And i_database=1 And ls_dbfile=gs_locpath + '\ GGZB db' THEN//set up drive the
//IF FileExists (ls_driver_test) And FileExists (ls_dbfile) THEN
//RETURN True
//END IF
//END IF

Ls_location=gs_locpath + ""//get the application directory

Ls_driver_yy=ls_location + "dbodbc8. DLL
"Ls_start_yy=ls_location + "dbeng8. Exe
"
Ls_driver_xt=windir + "" + "dbodbc8. DLL
"Ls_start_xt=windir + "" + "dbeng8. Exe
"
IF Not ((FileExists (ls_driver_yy) And FileExists (ls_start_yy)) Or (FileExists (ls_driver_xt) And FileExists (ls_start_xt))) THEN
MessageBox (" engine error 1 ", "no database engine in the system and the dynamic link library! ~ r ~ n system will be terminated run!" , StopSign!)
RETURN False
END the IF

IF FileExists (ls_driver_xt) And FileExists (ls_start_xt) THEN
Ls_driver=ls_driver_xt
Ls_start=ls_start_xt
The ELSE
Ls_driver=ls_driver_yy
Ls_start=ls_start_yy
END the IF


Answer=RegistrySet (" HKEY_LOCAL_MACHINE \ Software \ ODBC \ ODBCINST INI \ ODBC Drivers ", "8.0" the Adaptive Server Anywhere, RegString! , "Installed")
IF Answer=1 THEN
MessageBox (" ODBC driver error 2 ", "system Settings of the Adaptive Server Anywhere 8 driver error", Information!)
RETURN False
END the IF

//set the ODBC \ ODBCINST INI
Answer1=RegistrySet (" HKEY_LOCAL_MACHINE \ Software \ ODBC \ ODBCINST INI \ the Adaptive Server Anywhere 8.0 ", "CPTimeout", RegString! , "not pooled")
Answer2=RegistrySet (" HKEY_LOCAL_MACHINE \ Software \ ODBC \ ODBCINST INI \ the Adaptive Server Anywhere 8.0 "and" Driver ", RegString! , ls_driver)
Answer3=RegistrySet (" HKEY_LOCAL_MACHINE \ Software \ ODBC \ ODBCINST INI \ the Adaptive Server Anywhere 8.0 ", "Setup", RegString! , ls_driver)
IF Answer1 Or Answer3 Or Answer2==- 1-1=1 THEN
Three MessageBox (" error ", "set up ODBC \ ODBCINST registry system! ~ r ~ n system will be terminated run!" , Information!
RETURN False
END the IF

Db_path=gs_locpath + "\ GGZB db//set the database path and file name
Db_name="GGZB"//set the database name
Ds_name="GGZB"//set the ODBC data source name

Answer=RegistrySet (" HKEY_CURRENT_USER \ Software \ ODBC \ ODBCINST INI \ ODBC Data Sources ", ds_name, RegString! Adaptiver Server Anywhere, "8.0")
IF Answer=1 THEN
MessageBox (" set up the data source error 4 ", "system set up the ODBC data source error! ~ r ~ n system will be terminated run!" , Information!
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related