Visual Fox Pro、ODBC - 我在 Visual Studio 2010 中看不到 .DBF 表 [英] Visual Fox Pro, ODBC - I can't see .DBF tables in Visual Studio 2010

查看:46
本文介绍了Visual Fox Pro、ODBC - 我在 Visual Studio 2010 中看不到 .DBF 表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与使用 ODBC 数据源的应用程序集成 - Visual Fox Pro 驱动程序.在它的目录结构中,我有两个包含 .DBF 文件的目录(DANE 和 TRANS).当我使用 Visual Studio 2010 Server Explorer -> Data Connections 连接到 DATA .DBF 文件时,一切正常.当我尝试使用 TRANS 目录时会出现问题 - 我没有看到任何表(当我使用 DBF 查看器时 - 大约有 30-40 个表).当我尝试使用连接字符串连接到它们时:

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

我可以毫无问题地从 DANE 获取数据.在 TRANS 我可以连接到数据库,但是当我尝试获取数据时出现异常(OleDbException) - 无法读取文件 c:\Softech\G_POS\TRANS\"name of table".dbf诺伯特

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 数据库"是目标的抽象名称.那不是数据库,只是我自定义的数据源名称

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

推荐答案

问题来自指定的 DSN.默认的Visual FoxPro 数据库"ODBC 数据源假定在数据源或 SourceDB 属性中指定了数据库容器 (DBC).这等同于 SourceType 属性,如 SourceType=DBC.

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.

您应该切换到使用Visual FoxPro 表"DSN 或将 DBC 的文件名附加到数据源属性.

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

此外,根据 Foxpro Ole Db文档,您应该使用数据源"或 DSN,但不能同时使用.

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

这篇关于Visual Fox Pro、ODBC - 我在 Visual Studio 2010 中看不到 .DBF 表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆