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

Jim DeMarco Jdemarco at hshhp.org
Thu Sep 25 09:44:09 CDT 2003


OK I finally got this working via the OLEDB provider (after getting an mdb linked up to the tables and the data processed there!).  The trick was to not reference the dbf file name in the Data Source property.

<snip>
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset
    Set cnn = New Connection
    cnn.Open "Provider=vfpoledb;" & _
           "Data Source=\\Data;" & _
           "Mode=ReadWrite|Share Deny None;" & _
           "Collating Sequence=MACHINE;" & _
           "Password=''"
    Debug.Print cnn.State
    Set rs = New ADODB.Recordset
    rs.Open "Select * from Persnl", cnn, adOpenKeyset, adLockOptimistic
    Debug.Print rs.RecordCount
    Set rs = Nothing
    Set cnn = Nothing
</snip>

Thanks,

Jim DeMarco
Director of Product Development
HealthSource/Hudson Health Plan


-----Original Message-----
From: Jim DeMarco 
Sent: Thursday, September 25, 2003 8:03 AM
To: Access Developers discussion and problem solving
Subject: RE: [dba-VB] [AccessD] Slightly OT: FoxPro Tables via ADO


Thanks Marty.  I already had the able-consulting.com info (great resource that page).  Installed SP-7 but no luck (same error on oledb provider call).  We have an FP person here whe tells me there should be a dbc file but as far as I can see there is not on in this app.  I searched its folder and all sub-folders and couldn't find one.  I think the dbf file is the table and the dbc is the database (for reference in the ADO object).  Since I only have a dbf file I can't get into the table so far (other than linking via Access).

Jim DeMarco


-----Original Message-----
From: MartyConnelly [mailto:martyconnelly at shaw.ca]
Sent: Wednesday, September 24, 2003 2:52 PM
To: Access Developers discussion and problem solving;
dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] [AccessD] Slightly OT: FoxPro Tables via ADO


Are you using Jet SP-7 that corrects some ISAM driver problems
http://support.microsoft.com/?kbid=282010
also check here
http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForVisualFoxPro

Jim DeMarco wrote:

>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
>
>_______________________________________________
>dba-VB mailing list
>dba-VB at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-vb
>http://www.databaseadvisors.com
>
>
>  
>


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


***********************************************************************************
"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


***********************************************************************************
"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".
***********************************************************************************



More information about the AccessD mailing list