Board index » delphi » Attn: Bug in ADO/MIDAS

Attn: Bug in ADO/MIDAS

Sorry for the crosspost. I don't know which is the one most appropriate
forum for this hence the crosspost.

If there is  a text field 3 char wide in MSAccess table , a NVARCHAR field 3
char wide in SQL Server 7.0(running in a Windows 98 SE BOX) ,NVARCHAR field
3 char wide in MSDE , when you edit the field and enter values which have
two leading zeros(like 001, 002 ) the change count is zero and you can not
apply updates using client datasets. I have verified this using the adotest
demo that comes with Delphi 5 EE You can easily verify this by adding a
text(3) field in any of the tables in DBDEMOS/Northwind database. I have run
it in several machines and it is the same everywhere. All the patches
including the new one made available by Mark Edington a few days back have
been applied.
Has somebody else encountered this behavior before ?

Please also note that  this behavior seems to appear using ADO only. It does
not appear when using BDE to connect to the access/MS SQL server databases
using either ODBC or Native drivers.

TIA & Regards
Paras

 

Re:Attn: Bug in ADO/MIDAS


Hey, we have the same problem ! I think anybody can attest to this.
Connect any table with VARCHAR(3) field to ADO/Midas. Open the
TClientDataSet and update that particular field to any string starting
with '00', can be 001 or 002 etc. Changecount remains 0 !? Hence you
cannot apply your update.

This happens when the original value already starts with '00' and try
to update the value  to another string that still starts with '00'. Try it
with Adotest.dpr demo program and see if you can reproduce this.

Quote
paras <paras.nos...@bkk.a-net.net.th> wrote in message

news:89qbs2$r9t4@bornews.borland.com...
Quote
> Sorry for the crosspost. I don't know which is the one most appropriate
> forum for this hence the crosspost.

> If there is  a text field 3 char wide in MSAccess table , a NVARCHAR field
3
> char wide in SQL Server 7.0(running in a Windows 98 SE BOX) ,NVARCHAR
field
> 3 char wide in MSDE , when you edit the field and enter values which have
> two leading zeros(like 001, 002 ) the change count is zero and you can not
> apply updates using client datasets. I have verified this using the
adotest
> demo that comes with Delphi 5 EE You can easily verify this by adding a
> text(3) field in any of the tables in DBDEMOS/Northwind database. I have
run
> it in several machines and it is the same everywhere. All the patches
> including the new one made available by Mark Edington a few days back have
> been applied.
> Has somebody else encountered this behavior before ?

> Please also note that  this behavior seems to appear using ADO only. It
does
> not appear when using BDE to connect to the access/MS SQL server databases
> using either ODBC or Native drivers.

> TIA & Regards
> Paras

Re:Attn: Bug in ADO/MIDAS


If found that when I use an MS Access database with text field, my TADOQuery
produces TWideString field components for them. My ClientDataSet then also
produces TWideString fields. When I change the fieldtype of my TWideString
fields to TStringFields, suddenly ChangeCount does increase when changing the
contents of such a field. Maybe changing the field type will work for you too.

Regards,

Erik Stok

paras schreef:

Quote
> Sorry for the crosspost. I don't know which is the one most appropriate
> forum for this hence the crosspost.

> If there is  a text field 3 char wide in MSAccess table , a NVARCHAR field 3
> char wide in SQL Server 7.0(running in a Windows 98 SE BOX) ,NVARCHAR field
> 3 char wide in MSDE , when you edit the field and enter values which have
> two leading zeros(like 001, 002 ) the change count is zero and you can not
> apply updates using client datasets. I have verified this using the adotest
> demo that comes with Delphi 5 EE You can easily verify this by adding a
> text(3) field in any of the tables in DBDEMOS/Northwind database. I have run
> it in several machines and it is the same everywhere. All the patches
> including the new one made available by Mark Edington a few days back have
> been applied.
> Has somebody else encountered this behavior before ?

> Please also note that  this behavior seems to appear using ADO only. It does
> not appear when using BDE to connect to the access/MS SQL server databases
> using either ODBC or Native drivers.

> TIA & Regards
> Paras

Re:Attn: Bug in ADO/MIDAS


It seems that the problem is more general because if you use Widestring with
Length x, if you change the x th character, MIDAS does not see it ! ( I have
made a test with MIDAS/ADO/JET4 ).

Quote
"Roderick" <reb...@hotmail.com> wrote in message

news:89uuml$1fh1@bornews.borland.com...
Quote
> Hey, we have the same problem ! I think anybody can attest to this.
> Connect any table with VARCHAR(3) field to ADO/Midas. Open the
> TClientDataSet and update that particular field to any string starting
> with '00', can be 001 or 002 etc. Changecount remains 0 !? Hence you
> cannot apply your update.

> This happens when the original value already starts with '00' and try
> to update the value  to another string that still starts with '00'. Try it
> with Adotest.dpr demo program and see if you can reproduce this.

> paras <paras.nos...@bkk.a-net.net.th> wrote in message
> news:89qbs2$r9t4@bornews.borland.com...
> > Sorry for the crosspost. I don't know which is the one most appropriate
> > forum for this hence the crosspost.

> > If there is  a text field 3 char wide in MSAccess table , a NVARCHAR
field
> 3
> > char wide in SQL Server 7.0(running in a Windows 98 SE BOX) ,NVARCHAR
> field
> > 3 char wide in MSDE , when you edit the field and enter values which
have
> > two leading zeros(like 001, 002 ) the change count is zero and you can
not
> > apply updates using client datasets. I have verified this using the
> adotest
> > demo that comes with Delphi 5 EE You can easily verify this by adding a
> > text(3) field in any of the tables in DBDEMOS/Northwind database. I have
> run
> > it in several machines and it is the same everywhere. All the patches
> > including the new one made available by Mark Edington a few days back
have
> > been applied.
> > Has somebody else encountered this behavior before ?

> > Please also note that  this behavior seems to appear using ADO only. It
> does
> > not appear when using BDE to connect to the access/MS SQL server
databases
> > using either ODBC or Native drivers.

> > TIA & Regards
> > Paras

Re:Attn: Bug in ADO/MIDAS


So what's the solution here, increase the size of the field with by one
character?

Quote
AVAUX <fabrice.av...@advalvas.be> wrote in message

news:8a5htj$6pg2@bornews.borland.com...
Quote
> It seems that the problem is more general because if you use Widestring
with
> Length x, if you change the x th character, MIDAS does not see it ! ( I
have
> made a test with MIDAS/ADO/JET4 ).

> "Roderick" <reb...@hotmail.com> wrote in message
> news:89uuml$1fh1@bornews.borland.com...
> > Hey, we have the same problem ! I think anybody can attest to this.
> > Connect any table with VARCHAR(3) field to ADO/Midas. Open the
> > TClientDataSet and update that particular field to any string starting
> > with '00', can be 001 or 002 etc. Changecount remains 0 !? Hence you
> > cannot apply your update.

> > This happens when the original value already starts with '00' and try
> > to update the value  to another string that still starts with '00'. Try
it
> > with Adotest.dpr demo program and see if you can reproduce this.

> > paras <paras.nos...@bkk.a-net.net.th> wrote in message
> > news:89qbs2$r9t4@bornews.borland.com...
> > > Sorry for the crosspost. I don't know which is the one most
appropriate
> > > forum for this hence the crosspost.

> > > If there is  a text field 3 char wide in MSAccess table , a NVARCHAR
> field
> > 3
> > > char wide in SQL Server 7.0(running in a Windows 98 SE BOX) ,NVARCHAR
> > field
> > > 3 char wide in MSDE , when you edit the field and enter values which
> have
> > > two leading zeros(like 001, 002 ) the change count is zero and you can
> not
> > > apply updates using client datasets. I have verified this using the
> > adotest
> > > demo that comes with Delphi 5 EE You can easily verify this by adding
a
> > > text(3) field in any of the tables in DBDEMOS/Northwind database. I
have
> > run
> > > it in several machines and it is the same everywhere. All the patches
> > > including the new one made available by Mark Edington a few days back
> have
> > > been applied.
> > > Has somebody else encountered this behavior before ?

> > > Please also note that  this behavior seems to appear using ADO only.
It
> > does
> > > not appear when using BDE to connect to the access/MS SQL server
> databases
> > > using either ODBC or Native drivers.

> > > TIA & Regards
> > > Paras

Re:Attn: Bug in ADO/MIDAS


Quote
paras <paras.nos...@bkk.a-net.net.th> wrote in message

news:89qbs2$r9t4@bornews.borland.com...

Quote
> Has somebody else encountered this behavior before ?

I just tested this and I can reproduce the problem.  I'm fairly certain the bug
is in Midas.dll so I can't give you any VCL code changes to solve the problem.
You might try adding persistent fields of type TStringField (instead of
TWideStringField) on the server.  I think that may avoid the problem.

Mark

Other Threads