Jump to content
Sign in to follow this  
rajeshontheweb

VisualFoxpro DBF Support?

Recommended Posts

rajeshontheweb

if it is a simple dbf file, i can open it with excel such kind of small simple dbf may probably be read directlky, but i am looking for an interface or something to read dbf files in autoit. is this possible in Autoit. currently i do have ADODB connection working in ms access. but i would be glad to see a standalone application which could interact with it. i dont need to add or edit records, just need to search and view reports thats all...

i did notice there has been a dll file but it looks like its obsolete, and i am not talking about DBAse dbf its VFP 7.x + dbf file.

Share this post


Link to post
Share on other sites
ResNullius

Download the VFPOleDb from Microsoft here:

http://www.microsoft.com/downloads/details...;displaylang=en

You can then access it using ADODB.

Hint, the connection string would be something like this:

$strConnection =  "Provider=vfpoledb.1;Data Source=C:\MyDbfFiles;Collating Sequence=general"
$oDBF = ObjCreate ("ADODB.Connection")
$oDBF.Open ($strConnection)

Where C:\MyDbfFiles is the folder the dbf file is in.

Have fun!

Share this post


Link to post
Share on other sites
rajeshontheweb

thanks for the insight,

but i've been through it.

trouble is with VFP ODBC Driver / VFP OLE DB Provider has to beinstalled on the pc !

you first need the MDAC components and then the oledb be installed (MDAC 2,.8 doesnt come with oledb provider now...)

this is the way i am working since about 5 years but after a long time i gave a thought on it and felt i could search and see if someone has provided a dll or something that would allow me to read the dbf files without MS drivers. cos MS drivers need installing first then connect with ADODB.

Share this post


Link to post
Share on other sites
ResNullius

The only other thing I've come across that works reliably and lends itself to scripting is this command line tool:

http://www.whitetown.com/cdbflite/

Not free... :D

Share this post


Link to post
Share on other sites
rajeshontheweb

yeah should have mentioned that, CDBF was one such product i came across but of course, its not free. and i am very bad at violating product licenses. i want license terms not be violated (to the farthest extent possible!) i aint buy it so i am not gonna use it! i was wondering if autoit had some functionality or people here (just like u people are showing interest, this is exactly the reason i put it here , thanks u guys)

Share this post


Link to post
Share on other sites
rosmild

Hi,

probably you are not interested in, but I've just made this script to extract rows from csv files and write in dbf files:

Global $Dbf
Global $File_in = "C:\input.csv"
Global $File_out = "output"

Func OpenDBFConn($Path)
  $Conn = ObjCreate("ADODB.Connection")
  $Conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;" & _
                   "Data Source=" & $Path & ";" & _
                   "Extended Properties=""DBASE IV;"";" )
  Return $Conn
EndFunc

$Dbf = OpenDBFConn("c:\")
$Dbf.Execute ("Create Table " & $File_out & " (code char(4), codeclient char(10), Doc_number char(10), sender char(50), email char(50))")

$file = FileOpen($File_in, 0)
$lineCount = 0

If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

While 1
    $lineCount += 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop
    If $lineCount > 1 Then
        $field = StringSplit($line, ";")
        $Dbf.Execute ("Insert into " & $File_out & "  Values('" & $field[1] & "','" & $field[2] & "','" & $field[3] & "','" & $field[4] & "','" & $field[5] & "')")
    EndIf
Wend

FileClose($file)

Rosmild

Edited by rosmild

Share this post


Link to post
Share on other sites
jchd

if it is a simple dbf file, i can open it with excel such kind of small simple dbf may probably be read directlky, but i am looking for an interface or something to read dbf files in autoit. is this possible in Autoit. currently i do have ADODB connection working in ms access. but i would be glad to see a standalone application which could interact with it. i dont need to add or edit records, just need to search and view reports thats all...

i did notice there has been a dll file but it looks like its obsolete, and i am not talking about DBAse dbf its VFP 7.x + dbf file.

You seem to know a number of related products/interfaces already, but wouldn't this fit your need for "search and view reports"? Sorry if you already know it isn't suitable for you, I'm just trying to help. Disclaimer: I didn't try it and I don't "recommend" it (but the thing looks like OK).

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.