none
Update dBASE IV through OleDB RRS feed

  • Question

  • Hello!

    I have an old foxpro 2.6 accounting system that must be moved to C#.
    The new system must support old dBASE IV backend and new mssql expr 2k5.
    Poblem is I can not figure out how to update dBASE files. Automatic
    command generation fails, as select statement does not return key columns:
    I get  exception Dynamic sql generation for UpdateCommand is not supported against SelectCommand that does not return any key column information

    I have tried to make DataTable.PrimaryKey work but no avail - it is for DataTable but commandbuilder works with DataAdapter.

    Is there any way to generate dynamic update/delete commands or I have to roll them on my own (for about 40 tables)?
    Monday, June 25, 2007 9:15 AM

Answers

  • I went and implemented my own update, insert and delete methods for my data class (data class holds connection string, connection states and DataSet, DataTable and other sutch things associated with given table).

    My update can do inserts based on RowState on DataSet. Delete is next in my todo list.
    Wednesday, July 4, 2007 7:38 AM

All replies

  • I went and implemented my own update, insert and delete methods for my data class (data class holds connection string, connection states and DataSet, DataTable and other sutch things associated with given table).

    My update can do inserts based on RowState on DataSet. Delete is next in my todo list.
    Wednesday, July 4, 2007 7:38 AM
  • Hi arand,

     

    Could you please show me how we create out own insert, update, and delete statements? I am running into the same problem as you did. I do not have the primary key in my dBase IV table and need to update the cell values. I am able to connect to the database using the OleDb Connection and display the table in DataGridView but I cannot save back the changes I make to the table.

     

    I have tried to create my own update statement but I am getting error messages with the update statement. Could you please show me how this is done?

     

    Your help in this regard is highly appreciated.

     

    Kind regards,

    Deepak.

     

    Wednesday, November 28, 2007 1:53 AM
  •  

    Hi Arand,

     

    Could you please share the code of your data class with us. I have the same problem, I have to update legacy DBF files from c#. Your data class source would be a great help.

     

    Please share the source here .

     

    Your help is highly appreciated.

     

    Gerzson

    Wednesday, December 12, 2007 9:03 AM
  • Hi Deepak!

     

    Did you received the source from Arand by any chance? If so could you please share with me. I have the same problem than you and Arand. Thanks

    Gerzson

     

    Wednesday, December 12, 2007 9:08 AM
  • Hi Anand,
    Can you please tell me how you conntected to dbase iv using oledb and .net with c#

    M S Rahate

    Thursday, December 13, 2007 8:43 AM
  • I solved the issue with Visual Foxpro OLEDB driver. The connection string is: Provider=vfpoledb.1;Data Source= ...;Collating Sequence=machine where ... is the name of the folder of the dbf file. If you need more information feel free to email to me.
    Friday, December 21, 2007 7:20 AM
  • I'm confused. Do you need to update dBase IV files or FoxPro 2.6 files? They are different.

     

    Friday, December 21, 2007 9:47 PM
  • Hi Craig!
    Thank you for your note.
    Actually I have to read/update DBF files used with Clipper database program. I don't know the exact version number of the dbf file.

    I have no knowledge of FoxPro. Back in the old days of 1990's I heard that it can handle DBF files. It was before MS acquired FoxPro. Based on this knowledge I downloaded the latest OleDB driver for FoxPro 9 and tried to open and modify the DBF files. And it seems to work. I had no chance yet to check whether the old Clipper application could use the DBF I appended to a record.

    Do you know any issue that may arise because of using the OleDB driver for FoxPro for DBF files? If so please share with us.
    Thanks
    Gerzson
    Saturday, December 22, 2007 5:22 AM