rkennebeck


I am trying to link a foxpro table in Microsoft Access 2003 using ODBC. The package I'm linking to is in VFP 9 (I believe).

When I do the link, and then try to open the table, it says:

"The field is too small to accept the amount of data you attempted to add...."

When I view the structure in Access, I notice that there are several binary fields. When I query the table specifically leaving out the binary fields, I don't get the error. These fields would normally be character fields since they contain addresses, phone numbers and zip codes, but for some reason they used a binary field instead of character fields.

These fields do not appear to be memo fields since they have a length on them such as 12, 15, etc.

I can open this table up in Excel and I see the data in those fields and it appears to be the hex version of the character data.

How do I read this information in Microsoft Access

Thanks in advance for your help.



Re: Linking Foxpro table to Access 2003

CetinBasoz


Sounds like the programmer used varbinary(12) or blob datatype for the column instead of using nocptrans. You can edit your SQL getting the data I think (at least with ADO). If so and you're sure that they would be char data, you can cast to char. ie:

select cast(myField as varchar(20)) as MyField from myTable

select cast(myField as c(20)) as MyField from myTable

select cast(myField as m) as MyField from myTable





Re: Linking Foxpro table to Access 2003

rkennebeck

Thanks for your help. I'm working strictly in Access with Access SQL so there isn't a Cast function available. Do you have any other suggestions

I've tried left, chr, str, etc and they all fail with the same error.






Re: Linking Foxpro table to Access 2003

CetinBasoz

Access might not have cast function but VFP has. If you use VFPOLEDB and get the data using OLEDB (something like using a udl file, I don't know how you do it in Access) you'd exactly use that kind of SQL. In other words you're using SQL that's understood by VFP not Access.





Re: Linking Foxpro table to Access 2003

rkennebeck

Thanks, I'll try that. Appreciate your time!