Board index » delphi » Corrupting Paradox Tables

Corrupting Paradox Tables

I have been having a lot of problems with using paradox tables and
Delphi 2.  If more than one user uses my application, some times the
index becomes out of date or the table becomes corrupt.
The problem does not seem to happen when only one user is using it at
a time.

(This post is kind'a long but I want to put all details so that
whoever that can help me will have enough information.)

Here is the set up:
- Net directory is set up correctly on the file server.
- All clients are running win95 with the BDE that came with D2.
    IDAPI32.DLL 2/04/1996 02:01:48  
- Every Table that corrupts has autoinc field
(Bad idea I know.  I found out too late.)
- I am not doing anything unusual like calling BDE directly.  Only DB
Components like, TTable, TQuery, addrecord, edit, post, etc.

This is what I have to do to fix the index out of date error.
1. The application says that the index is out of date on table
MyTable.
2. I load paradox and make sure it's the table and not some other
problem.
3. Table repair in paradox doesn't do jack.
4. I delete MyTable.px, xg0, yg0
5. I run Table repair, it usually tells me it's ok after I delete the
index files.
6. Bring the table up in Paradox and try to add a record.
Usually I find that the New record's autoinc field is smaller than the
last record.  So I add couple of records so that the next record's
autoinc field will be the largest number.  Then delete the records
that I created to bump the autoinc counter up.
7. Restructure the table to add the primary and secondary indexes
back.

I have also encountered situations where the table becomes completely
corrupt and nothing can open it or fix it.  I have to restore from
backup.

Neither of the above problems involve the client machine locking up or
anything in that nature.

Now, my question is,
Is it the Autoinc field?  Does Delphi just not support it well?  It
seems like BDE is not locking the record properly since it never
happens when only one person is using the app.
I am about to put 'bdiSaveChanges' to all the afterpost events to see
if that will fix it but I would like to know if there is anything that
I am missing.

Thank you !!
J. S. Nakamura
jnaka...@kiva.net

 

Re:Corrupting Paradox Tables


J. S. Nakamura <jnaka...@kiva.net> wrote in article
<517hnj$...@gretle.intersource.com>...

Quote
> I have been having a lot of problems with using paradox
tables and
> Delphi 2.  If more than one user uses my application,
some times the
> index becomes out of date or the table becomes corrupt.
> The problem does not seem to happen when only one user is
using it at
> a time.
[..]
> Now, my question is,
> Is it the Autoinc field?  Does Delphi just not support it
well?  It
> seems like BDE is not locking the record properly since
it never
> happens when only one person is using the app.
> I am about to put 'bdiSaveChanges' to all the afterpost
events to see
> if that will fix it but I would like to know if there is
anything that
> I am missing.

> Thank you !!
> J. S. Nakamura
> jnaka...@kiva.net

I have no direct experience with the AutoInc fields, but
the problem is probably more generic.
I believe it has to do with BDE caching the tables locally.
Not only dbiSaveChanges would be desirable, but also
TTable.Refresh before TTable.Edit.
If you're certain that BDE is configured correctly, that's
the only thing I can think of.

HTH
Peter

Re:Corrupting Paradox Tables


J.S.,

Definately check the caching of local tables...A sure way to corrupt
indicies.  As far as autoincrement fields go, the more I read, the more I
am convinced NOT to use them.  In master-detail relationships, I have seen
them referred to as "orphan makers".  I have read instances where a table
got corrupted with an autoincrement field in the index and upon rebuilding
the table, the detail records no longer linked to the master records...the
autoincrement field was rebuilt!!!!

Another tip I saw related to the BDE configuratione on a windows for
workgroups network.  Kirk{*word*106}enson had very similar problems with indicies
going out of date.  He fixed the problem by using the UNC naming convention
in his BDE configuration.  There is a technical information document on the
Borland site in the BDE/Paradox section dealing with the BDE on a peer to
peer network (forgot the ti####, sorry).

Hope this helps, please forward solution via email.

-Anthony

J. S. Nakamura <jnaka...@kiva.net> wrote in article
<517hnj$...@gretle.intersource.com>...

Quote
> I have been having a lot of problems with using paradox tables and
> Delphi 2.  If more than one user uses my application, some times the
> index becomes out of date or the table becomes corrupt.
> The problem does not seem to happen when only one user is using it at
> a time.

> (This post is kind'a long but I want to put all details so that
> whoever that can help me will have enough information.)

> Here is the set up:
> - Net directory is set up correctly on the file server.
> - All clients are running win95 with the BDE that came with D2.
>     IDAPI32.DLL 2/04/1996 02:01:48  
> - Every Table that corrupts has autoinc field
> (Bad idea I know.  I found out too late.)
> - I am not doing anything unusual like calling BDE directly.  Only DB
> Components like, TTable, TQuery, addrecord, edit, post, etc.

> This is what I have to do to fix the index out of date error.
> 1. The application says that the index is out of date on table
> MyTable.
> 2. I load paradox and make sure it's the table and not some other
> problem.
> 3. Table repair in paradox doesn't do jack.
> 4. I delete MyTable.px, xg0, yg0
> 5. I run Table repair, it usually tells me it's ok after I delete the
> index files.
> 6. Bring the table up in Paradox and try to add a record.
> Usually I find that the New record's autoinc field is smaller than the
> last record.  So I add couple of records so that the next record's
> autoinc field will be the largest number.  Then delete the records
> that I created to bump the autoinc counter up.
> 7. Restructure the table to add the primary and secondary indexes
> back.

> I have also encountered situations where the table becomes completely
> corrupt and nothing can open it or fix it.  I have to restore from
> backup.

> Neither of the above problems involve the client machine locking up or
> anything in that nature.

> Now, my question is,
> Is it the Autoinc field?  Does Delphi just not support it well?  It
> seems like BDE is not locking the record properly since it never
> happens when only one person is using the app.
> I am about to put 'bdiSaveChanges' to all the afterpost events to see
> if that will fix it but I would like to know if there is anything that
> I am missing.

> Thank you !!
> J. S. Nakamura
> jnaka...@kiva.net

Re:Corrupting Paradox Tables


I failed to mention that the files server is Netware 4.1 and all the
client machines are running Novell Client 32.  I have discovered the
following on latest patch on the client 32.

Taken from the c3295d.txt file included in c3295d.exe dowloaded from
Novell.

Quote
> CLIENT32.NLM

> 13-  Solves problems related to corruption in various databases and
> mail programs (i.e. CC:Mail) dealing with opportunistic locking.

Does anyone know if this applies to Delphi 2 with paradox tables?

I have patched the Client and I will see if the problem goes away or
not...

Quote
I wrote:
>I have been having a lot of problems with using paradox tables and
>Delphi 2.  If more than one user uses my application, some times the
>index becomes out of date or the table becomes corrupt.
>The problem does not seem to happen when only one user is using it at
>a time.
>(This post is kind'a long but I want to put all details so that
>whoever that can help me will have enough information.)
>Here is the set up:
>- Net directory is set up correctly on the file server.
>- All clients are running win95 with the BDE that came with D2.
>    IDAPI32.DLL 2/04/1996 02:01:48  
>- Every Table that corrupts has autoinc field
>(Bad idea I know.  I found out too late.)
>- I am not doing anything unusual like calling BDE directly.  Only DB
>Components like, TTable, TQuery, addrecord, edit, post, etc.
>This is what I have to do to fix the index out of date error.
>1. The application says that the index is out of date on table
>MyTable.
>2. I load paradox and make sure it's the table and not some other
>problem.
>3. Table repair in paradox doesn't do jack.
>4. I delete MyTable.px, xg0, yg0
>5. I run Table repair, it usually tells me it's ok after I delete the
>index files.
>6. Bring the table up in Paradox and try to add a record.
>Usually I find that the New record's autoinc field is smaller than the
>last record.  So I add couple of records so that the next record's
>autoinc field will be the largest number.  Then delete the records
>that I created to bump the autoinc counter up.
>7. Restructure the table to add the primary and secondary indexes
>back.
>I have also encountered situations where the table becomes completely
>corrupt and nothing can open it or fix it.  I have to restore from
>backup.
>Neither of the above problems involve the client machine locking up or
>anything in that nature.
>Now, my question is,
>Is it the Autoinc field?  Does Delphi just not support it well?  It
>seems like BDE is not locking the record properly since it never
>happens when only one person is using the app.
>I am about to put 'bdiSaveChanges' to all the afterpost events to see
>if that will fix it but I would like to know if there is anything that
>I am missing.
>Thank you !!
>J. S. Nakamura
>jnaka...@kiva.net

J. S. Nakamura
jnaka...@kiva.net

Re:Corrupting Paradox Tables


Quote
J. S. Nakamura wrote:

> I failed to mention that the files server is Netware 4.1 and all the
> client machines are running Novell Client 32.  I have discovered the
> following on latest patch on the client 32.

> Taken from the c3295d.txt file included in c3295d.exe dowloaded from
> Novell.

> > CLIENT32.NLM

> > 13-  Solves problems related to corruption in various databases and
> > mail programs (i.e. CC:Mail) dealing with opportunistic locking.

> Does anyone know if this applies to Delphi 2 with paradox tables?

> I have patched the Client and I will see if the problem goes away or
> not...

Please post whether or not that solved your problem.

  Ted Herrlich

--

"The Pen is Mightier than the Sword, unless you are One on One."

Re:Corrupting Paradox Tables


In article <51f4cq$...@gretle.intersource.com>, From jnaka...@kiva.net
(J. S. Nakamura), the following was written:

Quote
>> I failed to mention that the files server is Netware 4.1 and all the
> client machines are running Novell Client 32.  I have discovered the
> following on latest patch on the client 32.

> Taken from the c3295d.txt file included in c3295d.exe dowloaded from
> Novell.

>> CLIENT32.NLM

>> 13-  Solves problems related to corruption in various databases and
>> mail programs (i.e. CC:Mail) dealing with opportunistic locking.

> Does anyone know if this applies to Delphi 2 with paradox tables?

> I have patched the Client and I will see if the problem goes away or
> not...

I have not been at all happy with Novell Client 32.  I switched to
Client for Netware that comes from Microsoft.

my $.02

--
Jay Schwisow j...@weldnet.com
09/17/96 00:46
---------
Using: OUI PRO 1.5.0.2 from http://www.dvorak.com

Other Threads