开发者

Visual Fox Pro, ODBC - I can't see .DBF tables in Visual Studio 2010

开发者 https://www.devze.com 2023-01-17 05:46 出处:网络
I\'m making integration with application that is using ODBC Data Source - Visual Fox Pro Driver. In its dirrectory structure I\'ve got two d开发者_C百科irrectories (DANE and TRANS) which contains .DBF

I'm making integration with application that is using ODBC Data Source - Visual Fox Pro Driver. In its dirrectory structure I've got two d开发者_C百科irrectories (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


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消