PowerBuilder Connect DBF Database Using ODBC
PowerBuilder Connect dBase Database DBF
PowerBuilder Connect XBase Database DBF
PowerBuilder Connect FoxPro Database DBF
Step 1: Install Driver ODBC DBF Database. Driver do Microsoft dBase (*.dbf)
Step 2: Registry Regedit With Run file .Reg or PowerBuilder Function RegistrySet()
Step 3: Test Connect
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | String ls_db, ls_database, ls_user, ls_pass, ls_odbcjt32 If wf_GetOSBits() = 64 Then //Check Windown 32/64 bit ls_odbcjt32 = "C:\Windows\SysWOW64\odbcjt32.dll" Else ls_odbcjt32 = "C:\Windows\System32\odbcjt32.dll" End If ls_db = "PBDBF" ls_database = "folder of dbf file" //set database Transaction.database or odbc DefaultDir //RegistrySet("HKEY_CURRENT_USE\Software\ODBC\ODBC.INI\"+ls_db,"DefaultDir",RegString!,ls_database) RegistrySet("HKEY_CURRENT_USE\Software\ODBC\ODBC.INI\"+ls_db,"Driver",RegString!,ls_odbcjt32) RegistrySet("HKEY_CURRENT_USE\Software\ODBC\ODBC.INI\"+ls_db,"DriverId",ReguLong!,533) RegistrySet("HKEY_CURRENT_USE\Software\ODBC\ODBC.INI\"+ls_db,"FIL",RegString!,"dBase 5.0") RegistrySet("HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\ODBC DATA SOURCES",ls_db, RegString!, "Driver do Microsoft dBase (*.dbf)") RegistrySet("HKEY_CURRENT_USE\Software\ODBC\ODBC.INI\"+ls_db+"\Engines\Xbase","CollatingSequence",RegString!,"ASCII") RegistrySet("HKEY_CURRENT_USE\Software\ODBC\ODBC.INI\"+ls_db+"\Engines\Xbase","PageTimeout",ReguLong!,5) RegistrySet("HKEY_CURRENT_USE\Software\ODBC\ODBC.INI\"+ls_db+"\Engines\Xbase","Threads",ReguLong!,3) RegistrySet("HKEY_CURRENT_USE\Software\ODBC\ODBC.INI\"+ls_db+"\Engines\Xbase","ImplicitCommitSync",RegString!,"") Transaction ltran_conn //if isvalid(ltran_conn) then destroy ltran_conn ltran_conn = Create Transaction // Using ODBC Connect To MS DBF ltran_conn.DBMS = "ODBC" ltran_conn.database = ls_database ltran_conn.AutoCommit = False ltran_conn.DBParm = "ConnectString='DSN="+ls_db+"'" Connect Using ltran_conn ; If ltran_conn.SQLCode = -1 Then MessageBox('Warning','Connect Database Error' + ltran_conn.SQLErrText) Else MessageBox('Warning',"Connect Success!") End If Disconnect Using ltran_conn ; |
Find Projects On Github click here
Good Luck!