0
votes

I'm making integration with application that is using ODBC Data Source - Visual Fox Pro Driver. In its dirrectory structure I've got two dirrectories (DANE and TRANS) which contains .DBF files. When I am using Visual Studio 2010 Server Explorer -> Data Connections to connect to DATA .DBF files, everything work fine. The problem occurs when I'm trying to use TRANS dirrectory - I don't see any tables (When I am using DBF Viewer - there are around 30-40 tables). When I try to connect to them using connection strings :

Provider=vfpoledb;Dsn=Visual FoxPro Tables;Data source=c:\Softech\G_POS\DANE
Provider=vfpoledb;Dsn=Visual FoxPro Database;Data source=c:\Softech\G_POS\TRANS

I can get data from DANE without problem. On TRANS I can connect to database, but I've god exception when I try to get data (OleDbException) - Can't read file c:\Softech\G_POS\TRANS\"name of table".dbf Norbert


"Visual FoxPro Database" is abstract name of destination. That's not a database, just my custom name of data source

2

2 Answers

1
votes

The problem comes from the DSN specified. The default "Visual FoxPro Database" ODBC Data Source assumes a Database Container (DBC) is specified in the Data Source or SourceDB attributes. This equates to the SourceType attribute, as in SourceType=DBC.

You should switch to using the "Visual FoxPro Tables" DSN or appending the filename for the DBC to the Data Source attribute.

Also, according to the Foxpro Ole Db documentation, you should either use "Data Source" or DSN but not both.

0
votes

Maybe a dumb answer,

Your connection strings are not equal. You use "Database" in the second connection string but your'e talking about tables..

Greatz