PB Development notes connection access (original)

Source: Internet
Author: User

MDAC must be installed on the target machine. Program Code is as follows:

string ls_string, gs_apppath
gs_apppath = getcurrentdirectory ()
gs_apppath = gs_apppath + "/"
// determine whether the access driver has been installed on the system.
string ls_sys, ls_install
ls_sys = "HKEY_LOCAL_MACHINE/software/ODBC/odbcinst. INI/ODBC drivers "
registryget (ls_sys," Microsoft Access Driver (*. MDB) ", regstring !, Ls_install)
If trim (ls_install) <> "installed" then
MessageBox ("error", "Microsoft Access driver not installed ")
halt
end if
ls_string = "db1.mdb"
sqlca. DBMS = "ODBC"
sqlca. autocommit = false
sqlca. dbparm = "connectstring = 'driver = Microsoft Access Driver (*. MDB); "+ &
" uid = admin; "+ &
" Pwd =; "+ &
" usercommitsync = yes; "+ &
" Threads = 3; "+ &
" safetransactions = 0; "+ &
" pagetimeout = 5; "+ &
" maxscanrows = 8; "+ &
" maxbuffersize = 2048; "+ &
" fil = MS access; "+ &
" driverid = 25; "+ &
" defaultdir = "+ gs_apppath + "; "+ &
" DBQ = "+ ls_string +" '"

Connect;
If sqlca. sqlcode = 0 then
Open (w_main)
Else
Halt
End if
/* The following dynamic libraries are required
Pbodb90.dll
Pbdwe90.dll
Pbvm90.dll
Libjcc. dll
Libjlog. dll

*/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.