1. Simone Olianti
  2. PowerBuilder
  3. Monday, 13 May 2024 16:29 PM UTC

Hi everyone, I need to manage a .DBF file which is exposed from a PLC machine on a shared folder.
I found the way to handle it using the default Windows dbf ODBC driver.
The content of the file is retrieved correctly by PowerBuilder, but when I try to delete a record or truncate the table, it doesn't seem to work.

I've created a datastore to handle this file, everything seems to work wothout errors, but after a delete and commit, all the records are still there.
Insert seems to work correctly.

Unfortunately i havo no experience about .dbf files so i'll try here if anyone have some hints.



Accepted Answer
mike S Accepted Answer Pending Moderation
  1. Monday, 13 May 2024 17:26 PM UTC
  2. PowerBuilder
  3. # Permalink


dbf  'delete' does not remove the records.  it marks them as 'deleted'.  may be an option in the odbc connection on whether you can see 'deleted' records.

  1. Simone Olianti
  2. Tuesday, 14 May 2024 07:10 AM UTC
thanks mike, to make it work i had to check even "exclusive"
  1. Helpful
  1. Andreas Mykonios
  2. Tuesday, 14 May 2024 08:41 AM UTC
Wow... 30 years ago we had to use pack! :-) I had forgot that... DBase III, DBase IV and Clipper... Lost memories...

  1. Helpful
  1. mike S
  2. Tuesday, 14 May 2024 21:22 PM UTC
I only remembered because i stole the idea. i recently built an in-memory database for key/values (using datastores) and i needed to be able to delete values and 'rows' (groups of key/values). Its a bit complex, but in essence, marking a row with a delete flag and then ignoring it ended up running a lot faster than actually deleting a row.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 13 May 2024 16:41 PM UTC
  2. PowerBuilder
  3. # 1

Hi Simone;

  That could be because ...

  • File is write protected
  • You do not have write privileges to the shared folder
  • There is a Windows "Policy" setting blocking you.

Food for thought 

Regards ... Chris 

  1. Simone Olianti
  2. Monday, 13 May 2024 16:46 PM UTC
Hi Chris i've double checked but the file is not write protected.

I've also tried to copy it on a local folder of my working machine, and still fails. The funny part is that if i try to insert new records, it does work. Looks like only delete won't work
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 13 May 2024 17:03 PM UTC
If it does not with a local DBF file, then it could be your odbc driver.
  1. Helpful 1
There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.