PB Connect SQLite

Source: Internet
Author: User
Tags ole sqlite

Sqlite3 database, simple and powerful, compared to the INI file save user settings, more simple and secure, why use the data inventory user settings, by the developer to think about it
Enter the topic:
PB can be used in OLE DB in the case of ODBC without registration directly connected to the database, the following direct code, for the necessary reference
First, download sqliteodbc.exe, specific download location, directly to the online search, in fact, just need a sqlite3odbc.dll inside this file
Second, open the Database Profiles configuration option in PB
Provider Select Msdasql
Extended properties:driver=sqlite3 ODBC driver;database=d:\workspace\pb\penavicoqd\cfg.db; password=
Note If you do not have SQLITEODBC installed, you must manually register the SQLite3 ODBC driver key value
Such as


Profile CFG
SQLCA. DBMS = "OLE DB"
SQLCA. Autocommit = False
SQLCA. Dbparm = "provider= ' msdasql ', providerstring= ' Driver=sqlite3 ODBC driver;database=d:\workspace\pb\penavicoqd\cfg.db ; Password= ' "

Autoenrollment SQLite3 ODBC Driver
Public Function Boolean Pub_f_put_sysvar (string as_varcode, any aa_varvalue);//public function Pub_f_put_sysvar (string As_varcode,any Aa_varvalue) Returns Boolean
String As_varcode
Any Aa_varvalue

RETURN Pub_f_put_sysvar (as_varcode,aa_varvalue,true)

End Function

Public Function Boolean Of_regedit_driver (string as_path);//string val[]
String Val
String Key
Key = "Hkey_local_machine\software\odbc\odbcinst. Ini\sqlite3 ODBC Driver "
If Registryget ("Hkey_local_machine\software\odbc\odbcinst. INI "," SQLite3 ODBC Driver ", Regmultistring!,val) <> 1 Then
If Registryget (Key, "Driver", regstring!, Val) <> 1 Then
If Registryset (Key, "Driver", regstring!, as_path+ "\sqlite3odbc.dll") <> 1 then Return False
End If
If Registryget (Key, "Setup", regstring!, Val) <> 1 Then
If Registryset (Key, "Setup", regstring!, as_path+ "\sqlite3odbc.dll") <> 1 then Return False
End If
End If

Return True
End Function

PB Connect SQLite

Related Article

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.