[dba-VB] [AccessD] Slightly OT: FoxPro Tables via ADO

Jim DeMarco Jdemarco at hshhp.org
Wed Sep 24 11:40:19 CDT 2003


x-posted Accessd dba-VB

I'm trying to programmatically access data stored in FoxPro 7 tables (I'm told by the vendor that this is Visual FoxPro).  I can open an ADO connection using ODBC as follows:

<snip>
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset
    Set cnn = New Connection
    cnn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
           "SourceType=DBF;" & _
           "SourceDB=\\Data\Persnl.DBF;" & _
           "Exclusive=No"
    Debug.Print cnn.State
    Set rs = New ADODB.Recordset
    'Set rs = cnn.Execute("Select * from Persnl")
    rs.Open "Persnl", cnn
    Debug.Print rs.RecordCount
    Set rs = Nothing
    Set cnn = Nothing
</snip>

The Connection State property returns a 1 which I believe means the connection is open.  The question is how to loop through the Persnl.dbf table? The call to open the recordset fails with an error from the FP driver saying "unrecognized command verb".

I also found and downloaded a VFP 8.0 oledb driver and similar code gives me this error: "The object invoked has disconnected from its clients"

Does anyone have any experience with this?  We're trying to get some of our HR info up our intranet and this is how it's stored.  I'm going to be using a VB app to run an export from VFP otherwise I'd just link to an Access system to pull the data (which may be the best way at this point).

TIA,

Jim DeMarco
Director of Product Development
HealthSource/Hudson Health Plan


***********************************************************************************
"This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited.  If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message.  Thank You".
***********************************************************************************

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the dba-VB mailing list