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