Updating DBF files

Results 1 to 3 of 3

Thread: Updating DBF files

  1. #1
    Bailey Guest

    Default Updating DBF files

    Hello, I normally work with SQL Server, but I unfortunately have to use a DBF file for an application. Is there a limitation in updating these type of databases? I have the file set up as a system DSN and I am opening a recordset. I am then trying to add a record to it. How can I do this? I can view information in my recordset, but updating gives me an..<BR><BR>[Microsoft][ODBC dBase Driver] Cannot update. Database or object is read-only. <BR><BR>Below is my code:<BR>&#060;%<BR>Set CON_LGN = Server.CreateObject("ADODB.Connection")<BR>SET RS_LGN = Server.CreateObject( "ADODB.Recordset" )<BR>CON_LGN.Open "DSN=LABELS; DATABASE=MyDBF"<BR>SQL_LGN = "SELECT * FROM MyDBF"<BR>With RS_LGN<BR> .Open SQL_LGN, CON_LGN, 2, 2<BR>End With<BR><BR>rs_LGN.addNew<BR>rs_LGN("LBLNAME")= "LABEL.LBL"<BR>rs_LGN("LBLQTY") = "1"<BR>rs_LGN.Update<BR>%&#062;<BR><BR>I have the file security set so Everyone has full control and I don&#039;t see anything under the System DSN where I can set security. I guess my question is..can DBF files be updated? If so, how do I get security set correctly? Thanks a ton for any help! Best regards, Bailey

  2. #2
    Join Date
    Dec 1969

    Default RE: Updating DBF files

    Of course you can update DBF files, I use DBF files in EVERY application. They are extremely fast and portable.<BR><BR>I use SQL, not ADO, so my update syntax is like this:<BR><BR>UPDATE &#039;datadir/table&#039; SET This = &#039;" & That & "&#039; WHERE Blah = &#039;" & Bzorg & "&#039;"<BR><BR>By the way, are you using a Visual FoxPro driver?

  3. #3
    Bailey Guest

    Default RE: Updating DBF files

    I will try using the SQL UPDATE command. I am using the standard DB IV driver--the database itself was created in the labeling software I am using, so I&#039;m not sure about it being FoxPro. I really didn&#039;t know much about DBF files. I was assuming they were standard database files, but this stumped me. Why wouldn&#039;t I be able to update via the recordset?? Hopefully UPDATE will work. Thanks so much for your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts