Visual FoxPro DB 中缺少表
我正在使用 VFPOLEDB 连接到 VFP 数据库(dbf 文件的目录)。
连接后,我使用以下命令手动创建一个表:
create dbf critera(field_name c(30))
此时,我验证在数据库目录中创建了一个新的 dbf 文件。然后我尝试查询新表,它应该不返回任何行。
select * from criteria
我收到以下错误:
File "criteria.dbf" does not exit.
奇怪,是吗?
所以我手动删除DBF文件(VFPOLEDB不支持drop),然后运行以下查询。
create db criteria(field_name c(30)); select * from criteria
并且没有错误,没有按预期返回结果。
什么给?有什么建议吗?
I'm using VFPOLEDB to connect to an VFP database (directory of dbf files).
Once connected, I manually create a table using:
create dbf critera(field_name c(30))
At this point, I verify a new dbf file is created in the database directory. I then try to query the new table, it should return no rows.
select * from criteria
I am presented with the following error:
File "criteria.dbf" does not exit.
Strange, eh?
So I manually delete the DBF file (VFPOLEDB doesn't support drop) and then run the following query.
create db criteria(field_name c(30)); select * from criteria
And get no error, no results returned as expected.
What gives? Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,(可能是 type-o),
然后
如果不是...对于您的连接字符串,您只是连接到 .dbf 文件所在的 PATH,还是显式连接到路径和数据库。
如果只是一个路径
或带有特定的数据库容器,
只需指向目录可能会更容易测试。 VFP OleDB 提供程序将考虑任何查询表的根路径与完整的 .dbc(数据库容器)的路径,后者可以让您访问其他存储过程等。
OleDb 不支持“DROP TABLE”。您仍然可以通过 OleDbCommand 的 ExecuteNonQuery() 运行 ERASE“Criteria.dbf”来删除文件
至于最后一个,VFP 不使用“;”像其他 SQL 引擎一样,作为语句之间的中断,您可以依次发送一系列查询。 “;”在 VFP 中被认为是“此命令在下一行继续”,并且应该抛出异常,因为它无法处理它。
First, (could be a type-o), you had
and then
If not that... for your connection string, are you just connecting to the PATH that the .dbf files will be located, or are you explicitly connecting to a path and database.
If just a path
Or with a specific database container
It might be easier to test just by pointing to the directory. The VFP OleDB provider will consider the path the root for any tables queried vs a full .dbc (database container) which could give you access to other stored procedures and such.
The OleDb doesn't support "DROP TABLE". You can still delete a file by running an ERASE "Criteria.dbf" via the OleDbCommand's ExecuteNonQuery()
As for the last one, VFP doesn't utilize the ";" as a break between statements like other SQL engines do where you could send a series of queries all together one after another. ";" in VFP is considered a "this command continues on the next line", and should have thrown an exception is it wouldn't have been able to process it.