查查手册不就行了么?XIX. dBase functions
Introduction
These functions allow you to access records stored in dBase-format (dbf) databases. There is no support for indexes or memo fields. There is no support for locking, too. Two concurrent webserver processes modifying the same dBase file will very likely ruin your database. dBase files are simple sequential files of fixed length records. Records are appended to the end of the file and delete records are kept until you call dbase_pack(). We recommend that you do not use dBase files as your production database. Choose any real SQL server instead; MySQL or Postgres are common choices with PHP. dBase support is here to allow you to import and export data to and from your web database, because the file format is commonly understood by Windows spreadsheets and organizers. Installation
In order to use these functions, you must compile PHP with the --enable-dbase option. Runtime Configuration
This extension does not define any configuration directives.Resource Types
This extension does not define any resource types.Predefined Constants
This extension does not define any constants.Table of Contents
dbase_add_record — Add a record to a dBase database
dbase_close — Close a dBase database
dbase_create — Creates a dBase database
dbase_delete_record — Deletes a record from a dBase database
dbase_get_record_with_names — Gets a record from a dBase database as an associative array 
dbase_get_record — Gets a record from a dBase database
dbase_numfields — Find out how many fields are in a dBase database 
dbase_numrecords — Find out how many records are in a dBase database 
dbase_open — Opens a dBase database
dbase_pack — Packs a dBase database
dbase_replace_record — Replace a record in a dBase database

解决方案 »

  1.   

    老兄,使你没看帮助还是我没看帮助,
    你看看这句话
    There is no support for indexes or memo fields. 
    你再看看我的要求!
      

  2.   

    目前无法存取 dBase 中的 indexes 或 memo 的栏位,亦无法将资料表锁上。它不是真正的资料库系统,仅是储存资料的资料表而已,二个以上的使用者同时存取同一个资料表时甚至可能会发生 dbf 资料表崩毁的情形。如果可能话,最好是用真正的资料库系统,如 MySQL 或 Oracle 等,就不会有多人使用时导至资料损毁的困扰。 
    dbase_create: 建立 dBase 资料表。 
    dbase_open: 开启 dBase 资料表。 
    dbase_close: 关闭 dBase 资料表。 
    dbase_pack: 清理 dBase 资料表。 
    dbase_add_record: 加入资料到 dBase 资料表。 
    dbase_delete_record: 删除 dBase 资料表的资料。 
    dbase_get_record: 取得 dBase 资料表的资料。 
    dbase_numfields: 取得 dBase 资料表的栏位数。 
    dbase_numrecords: 取得 dBase 资料表的列数。 
      

  3.   

    目前无法存取 dBase 中的 indexes 或 memo 的栏位,亦无法将资料表锁上。它不是真正的资料库系统,仅是储存资料的资料表而已,二个以上的使用者同时存取同一个资料表时甚至可能会发生 dbf 资料表崩毁的情形。如果可能话,最好是用真正的资料库系统,如 MySQL 或 Oracle 等,就不会有多人使用时导至资料损毁的困扰。 
    dbase_create: 建立 dBase 资料表。 
    dbase_open: 开启 dBase 资料表。 
    dbase_close: 关闭 dBase 资料表。 
    dbase_pack: 清理 dBase 资料表。 
    dbase_add_record: 加入资料到 dBase 资料表。 
    dbase_delete_record: 删除 dBase 资料表的资料。 
    dbase_get_record: 取得 dBase 资料表的资料。 
    dbase_numfields: 取得 dBase 资料表的栏位数。 
    dbase_numrecords: 取得 dBase 资料表的列数。 
    php.net上新提供的函数
    dbase_replace_record -- Replace a record in a dBase database
    dbase_get_record_with_names --  Gets a record from a dBase database as an associative array 
    所以要读memo没有好的办法
    浅妄薄见,望与斟酌
      

  4.   

    目前无法存取 dBase 中的 indexes 或 memo 的栏位,亦无法将资料表锁上。它不是真正的资料库系统,仅是储存资料的资料表而已,二个以上的使用者同时存取同一个资料表时甚至可能会发生 dbf 资料表崩毁的情形。如果可能话,最好是用真正的资料库系统,如 MySQL 或 Oracle 等,就不会有多人使用时导至资料损毁的困扰。 
    dbase_create: 建立 dBase 资料表。 
    dbase_open: 开启 dBase 资料表。 
    dbase_close: 关闭 dBase 资料表。 
    dbase_pack: 清理 dBase 资料表。 
    dbase_add_record: 加入资料到 dBase 资料表。 
    dbase_delete_record: 删除 dBase 资料表的资料。 
    dbase_get_record: 取得 dBase 资料表的资料。 
    dbase_numfields: 取得 dBase 资料表的栏位数。 
    dbase_numrecords: 取得 dBase 资料表的列数。 
    php.net上新提供的函数
    dbase_replace_record -- Replace a record in a dBase database
    dbase_get_record_with_names --  Gets a record from a dBase database as an associative array 
    所以要读memo没有好的办法
    浅妄薄见,望与斟酌
      

  5.   

    那没办法了~得懂DBF格式,还要写文件控制,够你累的.不如转成别的数据库呢.
      

  6.   

    我的意思是解决了给200分,我的结贴纪录是很好的,说到做到。上面的翻译我明白,我就想知道有没有谁写过这东西,因为我不想依赖数据库系统,所以考虑使用xml和dbf库,但是似乎都不行。我以为会有人写过这东西呢。
      

  7.   

    这个在php里实现可能会有些问题的,关键是并发控制很难做到。
    如果光要做到读写dbf格式的文件(包括memo和index)还是比较容易的,资料很多的,c/c++实现的源代码也很多,自己改改应该不复杂,但效率就很难保证,而且并发控制用php很难实现。
      

  8.   

    请教楼上:
    怎么读取memo?
      

  9.   

    读memo文件不难,我96年曾经用c写过读他的程序。
      

  10.   

    网上此类c/c++程序很多,改成php应该不难。
    著名的有codebase,不过这个是商业软件,源代码不常见到。
      

  11.   

    to pazee : 如果你写了C程序,转成PHP应该不难丫.
      

  12.   

    为什么不用odbc哪?
    odbc应该可以访问的,
    最好通过odbc倒到别的数据库里。
      

  13.   

    用odbc需要依赖系统,
    如果搬迁到别的机器上比如linux不就傻了!
      

  14.   

    不是啊,通过odbc导出到别的数据库系统去。
    我想,在linux下访问dbf怎么都比不上mysql吧。