duanouyong4228 2012-04-25 12:57
浏览 67
已采纳

FoxPro保留字问题?

I am attempting to read a foxpro table called SCHEDULE.dbf. The data is read in PHP via data connector then piped to my webpage. This all works wonderfully, provided I rename Schedule.dbf. Any name except Schedule seems to work. When I run it named Schedule, however, I get "SQL error: [Microsoft][ODBC dBase Driver] Index file not found., SQL state S0012 in SQLExecDirect" error message. My only idea is that Schedule is a reserved word someplace, but I can't find it on any list. I am at an utter loss. Renaming the table is not really an option as it is part of a larger data entry and management system that I would rather not modify. Any suggestions?

  • 写回答

2条回答 默认 最新

  • dongrong7267 2012-04-25 15:22
    关注

    I can't say for dBASE (and I would use Microsoft's OleDb provider specifically for VFP if it IS Foxpro data and not dBASE). In Foxpro, the system works with paired (or even triple) files. All corresponding file names need to be renamed, such as

    SCHEDULE.DBF (main data)
    SCHEDULE.CDX (compound index file for all indexes for given file)
    SCHEDULE.FPT (separate file if any memo/general data columns in the file)
    

    If you try to just rename the .DBF but not the rest (.FPT is only found IF a data column is of type memo or general), then it will choke opening the file.

    Additionally. If the table is part of a database container (via VFP), and you try to open it, the file has additional header information to point to the database it is bound to. If it can't find it in the database, that too could give you a misdirected error.

    Database Containers in VFP have suffix values of .DBC, .DCT and .DCX.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集