Home > database >  Pb10.5 asa9
Pb10.5 asa9

Time:09-26

Locally developed a small software, using asa9 database, connection code is as follows:
The SQLCA. DBMS="ODBC"
The SQLCA. The AutoCommit=False
The SQLCA. DBParm="Connectstring='DSN=ZZQ UID=' dbas' Wd='SQL'"
The connect.
The compiled exe file, run on a new computer, prompt questions as follows:

SQLSTATE=IM002
Not found the data source name did not specify a default driver

I want to achieve, the client don't have to install the database, can be directly run my small programs, how to implement, expert help,

CodePudding user response:

New the computer also need ASA9 engine!
In addition, the single machine, you can use the MDB database,
On your development computer, using the data import/export tool asa9. Db database import. MDB is ok,

CodePudding user response:

Access MDB database is the data access engine system at the Windows, do not need to install other programs alone,

CodePudding user response:

What about whether your program must use the database, if must be the best looking upstairs

CodePudding user response:

Asa also want to install on the client side? Should not, it is also a file. The db,

CodePudding user response:

One is running the runtime packager packaging running environment



The other is a direct copy of runtime library file

Pb9 runtime

PB9.0 required documents:

PBVM90. DLL original concept virtual machinePBDWE90. DLL DataWindow data window engine
LIBJCC. DLL original concept library management
PBTRA90. DLL database access track
PBODB90. DLL PB ODBC interface
PBMSS90. DLL Microsoft SQL Server interface
PBSYC90. DLL Sybase SQL Server interface

CodePudding user response:

In addition to need the above documents on the client, but also need to configure the data source, if the same system, the registry under the corresponding part of the export to the client

CodePudding user response:

It is best to use the registration data source code, I can offer the following function
Export format, and then save the import for SRD file can

Global type of_set_datasource from function_object
End type

Forward as
Global function Boolean of_set_datasource ()
End as

Global function Boolean of_set_datasource ();//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 \ HLCM ", "DatabaseFile", RegString! , ls_dbfile)

//the 2010-03-02
IF Mid (ls_driver_test, (Len (ls_driver_test) - 10), 11)='dbodbc8. DLL' And i_database=1 And Mid (ls_dbfile, (Len (ls_dbfile) - 6), 7)='HLCM. Db' THEN//set up drive the
IF FileExists (ls_driver_test) And FileExists (ls_dbfile) THEN
//MessageBox (" ^_^ ", "has already set up the data source")
RETURN True
END the IF
END the IF


//RegistryGet (" HKEY_LOCAL_MACHINE \ Software \ ODBC \ ODBCINST INI \ the Adaptive Server Anywhere 8.0 "and" Driver ", RegString! , ls_driver_test)
//
//IF Mid (ls_driver_test, (Len (ls_driver_test) - 10), 11)='dbodbc8. DLL' THEN//that are set up drive
//RETURN True
//END IF

//RegistryGet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ HLCMSQL ", "DatabaseFile", RegString! , ls_dbfile)
//
//IF Not FileExists (ls_dbfile) THEN
//MessageBox (" warning ", ") specified in the registry database file "+ ls_dbfile +" does not exist ")
//RETURN False
//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 + "\ HLCM db//set the database path and file name
Db_name="HLCM"//set the database name
HLCM ds_name=""//set the ODBC data source name

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related