Re:Mystery messages with Delphi 2.0 and MS SQL Server
nytil heeft geschreven in bericht <34DC63CD.6...@hotmail.com>...
Quote
>Hi! Folks,
>I am using D2 alongwith MS SQL 6.5, my project has been on for the past
>5 months and in my experience of 5 months i have been able to find
>solutions ( not always satisfactory ) to most of my problems in Borland
>Newsgroups ( this is where Borland scores over Microsoft ). But there
>are a few things for which I have still not found any clues or answers.
>Here is a list of them
>BDE messages - very simple but difficult to understand
>Connection in use by another statement - after this I have to shutdown
>my application
>and bcos of this my client is screaming.
>Operation Not Applicable - This generally happens when I have edited a
>Master-Detail relationship (either Master or Detail ) and then posted
>them. It works fine the first time. If I make changes again, and try to
>commit them I get this simple, cute message
>Update Failed - This one is really mystifying, my form was doing great
>when suddenly out of the blue comes this message, no changes have been
>made to the related tables at the backend and everything is as it is.
>To briefly describe my application, it has a total of 263 tables with
>records running upto as many as > 100,000 records in certain tables. I
>have always worked with Master - Detail relationships and found them to
>be good enough though they can be a pain sometimes.
>My life would be much more easier if some good samatarian amongst
>youlearned people would shed some light on the above mystifying messages
>(as I call them )
>Regards
>Nytil
Connection in use : sometimes this can besolved by using First, Last
command.
This is true when requesting the server
date/time using a query.
Last two problems :
I experienced severe problems under the following circustances :
- MS Sql server version 6.5 service pack 4.
- Delphi 2.0 thru 3.02
- BDE version 3.5 thru 4.51.
- Using Tquery objects cached updates =true, request live = false, applying
data to the SQL server
using Update objects.
If you :
- create several new records within a query without refreshing the
uery( each record seperatly
applied to the server(with succes)).
- create a new record and apply to server (with succes).
- modify the last record so that the server will generated a constraint
error.
- apply the changes to the server ( which result in an error) (don't refresh
the query).
- if you now modify the same record so that it is correct
- apply the changes to the server(this will not work).
it seems that Delphi is now trying to insert all new records to the
server. The TQuery.UpdateStatus will be usInserted for all newly created
records. Within the OnUpdate invent handler the updatekind will be
usInserted and Delphi lost track of the oldvalues( they will be null).
If you do the above within a master/ detail relation you will have an
"Operation not applicable" error
after a call to TQuery.Cancel and a TDataBase.CancelUpdates([...,...]) and
trying to edit another record.
The above is reported to Borland. No answers yet.
From several sources I know that the probleem should be known by Borland for
a long time.
(about a year!)
Update Failed error: This error is generated within the code of TUpdateSql
component.
In general this error will be generated
if the server returns 0 rows affected.
E.g. you make a call to
TUpdateSql.ApplyUpdates(updatekind) and the
sql statement processed 0 rows on the
server. The sql statement itself is
correct.
Beware : The error is presented to the
user before the transaction is rolled
back. As long as the message is on the
screen there is an active transaction.
Kind regards,
Wim Entrop
E...@BS.IMTECH.NL