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

喜欢而已 提交于 2019-12-25 04:22:29

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/3787261/visual-fox-pro-odbc-i-cant-see-dbf-tables-in-visual-studio-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!