Using VB to open FoxPro .dbf & .fpt

This is a discussion on Using VB to open FoxPro .dbf & .fpt within the ODBC forums in Framework and Interface Programming category; Help! IN VB6 I'm trying to open a FoxPro .dbf with a memo field (.fpt file). I've tried every driver I can find... I always get the error "External table isn't in the expected format" when the database I open has an associated .fpt file. If the dbf has no memo file I'm fine. I've installed the lastest FoxPro ODBC drivers from VFPODBC.msi What am I missing? Thank you in advance, Tim...

Go Back   Application Development Forum > Framework and Interface Programming > ODBC

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 12-26-2007, 08:01 PM
TCS
Guest
 
Default Using VB to open FoxPro .dbf & .fpt

Help! IN VB6 I'm trying to open a FoxPro .dbf with a memo field (.fpt file).
I've tried every driver I can find... I always get the error "External table
isn't in the expected format" when the database I open has an associated .fpt
file. If the dbf has no memo file I'm fine.

I've installed the lastest FoxPro ODBC drivers from VFPODBC.msi

What am I missing?

Thank you in advance,

Tim

Reply With Quote
  #2  
Old 12-27-2007, 12:00 AM
Ralph
Guest
 
Default Re: Using VB to open FoxPro .dbf & .fpt


"TCS" <TCS@discussions.microsoft.com> wrote in message
news:2C7E14E0-D62C-45D1-AF60-70BB00ABB57D@microsoft.com...
> Help! IN VB6 I'm trying to open a FoxPro .dbf with a memo field (.fpt

file).
> I've tried every driver I can find... I always get the error "External

table
> isn't in the expected format" when the database I open has an associated

..fpt
> file. If the dbf has no memo file I'm fine.
>
> I've installed the lastest FoxPro ODBC drivers from VFPODBC.msi
>
> What am I missing?
>
> Thank you in advance,
>
> Tim
>


Not sure if this will help, as I stopped using ODBC/DAO with newer versions
of FoxPro. I recommend using ADO/OLEDB:
OLEDB
http://www.microsoft.com/downloads/d...displaylang=en
(Never use an ODBC with ADO, unless under duress. <g>)

What version of FoxPro are you using?

I'm sure you have covered all this, but ... <g>
Make sure both files dbf and fpt are in the same folder.
That they have the same name except for extension.
Most of the dbf is in ascii format. So you can open the file read the memo
field and then take a peek inside the fpt to make sure there is a descriptor
for the one given.
Have you tried packing the memo file? (This is pure supersition, but it
worked for me once, so I always do if I get any problems. <g>)


Reply With Quote
  #3  
Old 12-27-2007, 07:10 PM
TCS
Guest
 
Default Re: Using VB to open FoxPro .dbf & .fpt

Ralph,

Thank you for posting! I have tried the vfpoledb.exe with no success.

To make sure that I wasn't dealing with a corrupt file, I created a simple
two record, two field test DB in FoxPro with a memo field. All great ideas
and we obviouly think alike in that regard!

I can't even find an example piece of code anywhere on the net that deals
with creating a connection to a FoxPro dbf that has an fpt file.

Currently I use a product from successware to read the data and load a
table. I'd love to have a bound table!

Best,

Tim

"Ralph" wrote:

>
> "TCS" <TCS@discussions.microsoft.com> wrote in message
> news:2C7E14E0-D62C-45D1-AF60-70BB00ABB57D@microsoft.com...
> > Help! IN VB6 I'm trying to open a FoxPro .dbf with a memo field (.fpt

> file).
> > I've tried every driver I can find... I always get the error "External

> table
> > isn't in the expected format" when the database I open has an associated

> ..fpt
> > file. If the dbf has no memo file I'm fine.
> >
> > I've installed the lastest FoxPro ODBC drivers from VFPODBC.msi
> >
> > What am I missing?
> >
> > Thank you in advance,
> >
> > Tim
> >

>
> Not sure if this will help, as I stopped using ODBC/DAO with newer versions
> of FoxPro. I recommend using ADO/OLEDB:
> OLEDB
> http://www.microsoft.com/downloads/d...displaylang=en
> (Never use an ODBC with ADO, unless under duress. <g>)
>
> What version of FoxPro are you using?
>
> I'm sure you have covered all this, but ... <g>
> Make sure both files dbf and fpt are in the same folder.
> That they have the same name except for extension.
> Most of the dbf is in ascii format. So you can open the file read the memo
> field and then take a peek inside the fpt to make sure there is a descriptor
> for the one given.
> Have you tried packing the memo file? (This is pure supersition, but it
> worked for me once, so I always do if I get any problems. <g>)
>
>
>

Reply With Quote
  #4  
Old 12-27-2007, 10:08 PM
Ralph
Guest
 
Default Re: Using VB to open FoxPro .dbf & .fpt


"TCS" <TCS@discussions.microsoft.com> wrote in message
news:0D280803-D5DB-4586-835B-0630F093E9B5@microsoft.com...
> Ralph,
>
> Thank you for posting! I have tried the vfpoledb.exe with no success.
>
> To make sure that I wasn't dealing with a corrupt file, I created a simple
> two record, two field test DB in FoxPro with a memo field. All great

ideas
> and we obviouly think alike in that regard!
>
> I can't even find an example piece of code anywhere on the net that deals
> with creating a connection to a FoxPro dbf that has an fpt file.
>
> Currently I use a product from successware to read the data and load a
> table. I'd love to have a bound table!
>
> Best,
>
> Tim
>

<snipped>

Wish I could be of more help. I have had trouble with FoxPro Memo fields as
well. A major problem has always been the specific version combination of
the data access library and provider/driver used - it either magically
works, or it magically fails. There isn't any real 'tinkering' you can do
beyond mixing 'n matching.

I have noticed that most 'official' documentation and articles usually
suggest converting the dbf and memo file to something else for exporting to
products like Excel or MSAccess. This suggest to me that even the 'experts'
have issues with them outside of FoxPro.

For working with FoxPro files (or any XBase files) from other environments
or platforms, especially for any critical applications, I use CodeBase.
http://www.codebase.com/products/
Unfortunately it is not cheap.

-ralph


Reply With Quote
  #5  
Old 12-27-2007, 10:13 PM
Ralph
Guest
 
Default Re: Using VB to open FoxPro .dbf & .fpt


"TCS" <TCS@discussions.microsoft.com> wrote in message
news:0D280803-D5DB-4586-835B-0630F093E9B5@microsoft.com...
> Ralph,
>
> Thank you for posting! I have tried the vfpoledb.exe with no success.
>
> To make sure that I wasn't dealing with a corrupt file, I created a simple
> two record, two field test DB in FoxPro with a memo field. All great

ideas
> and we obviouly think alike in that regard!
>
> I can't even find an example piece of code anywhere on the net that deals
> with creating a connection to a FoxPro dbf that has an fpt file.
>
> Currently I use a product from successware to read the data and load a
> table. I'd love to have a bound table!
>
> Best,
>


Forgot to mention...
I don't know what 'successware' is doing, But you might take a look at "Data
Aware Classes". This is a method where you create a class that acts like a
datasource for any OLEDB (ado) control. Thus you could move your 3rd party
code into the class and then bound to any control just as if you were using
ADO.

-ralph


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 01:14 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.