thank you for your explanation, I'm not very happy of this situation but I
have read that there are some problem like this on using ADO.
Really, in my last attach I have used an Access table only to emulate the
problem, if you see my message of 10 Jul 2009 there is one similar project
with an MS-SQL Table, with the same result. This for your 'work around'
thank and I hope in a good news
=?iso-8859-1?Q?Ignacio_Ortiz_de_Z=FA=F1iga?= <
NoNameToAvoidSpam@xailer.com>
wrote:
>Fabio,
>
>I am afraid the problem you are showing is surely due the really bad
>implementation of ADO for ACCESS done by M$.
>
>If you take a look at our code on method FieldPut() on AdoRecords.prg you
>can see that we take care to not update any field that is not updatable:
>
>IF lAnd( :Attributes, adFldUpdatable )
>
>So, it should do the work correctly, but it seems that for Access tables,
>all the fields are updatable.

>
>BTW, on you code you use:
>
>rs:Fields("Chiave"):properties("isautoincrement")
>
>To detect if the code is autoincremental and as I can see that information
>is well given, but I am afraid, the fact that a field is autoincremental
>does not mean it can not receive a value.
>
>This is not the first time we see a problem with Access and Ado
>implementation and surely it will not be the last. Before doing any 'work
>around' code to resolve M$ bugs I prefer to see if the problem persists
with
>other databases like MS SqlServer. BTW you can access the underlying ADO
>recordset object with the following code:
>
>oDataset:oRecords:oAdo
>
>Best regards,
>
>--
>Ignacio Ortiz de Zúñiga
>
http://www.xailer.com
>http:/xailer.info
>
>"Fabio" <
gianellini@coopservice.it> escribió en el mensaje de
>noticias:4a76d64c$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>>
>> Dear all, sorry for my late answer and my poor english but the problem
>> with
>> the autoincrement fields in the last version of Xailer persist.
>> I attach a little project with un Access table containing two fields (one
>> is an autoincrement and the second is a normal text field). in the main
>> form
>> there are two botton, the first use the Xailer dataset to insert some
>> data
>> and don't work with the autoincrement field. The second use the ADO
>> directly
>> and testing the 'isautoincrement' properties of the fields all work fine.
>> What can i do in Xailer???
>> thanks in advance
>> fabio
>>
>> "Fabio" <
gianellini@coopservice.it> wrote:
>>>
>>>no problem, i can wait the new release
>>>
>>>thank you for your help and most important
>>>
>>>compliments for the great job till now performed with Xailer
>>>
>>>=?iso-8859-1?Q?Ignacio_Ortiz_de_Z=FA=F1iga?=
>>><
NoNameToAvoidSpam@xailer.com>
>>>wrote:
>>>>
>>>>
>>>>Fabio,=20
>>>>
>>>>Ok. You are certenly right. We have already fixed the problem. In case
>> =
>>>>you can not wait until next release (this week) you can change the =
>>>>following on AdoRecords.prg:
>>>>
>>>>METHOD FieldPut( nField, Value ) CLASS XAdoRecords
>>>>
>>>> IF ::lOnAppend
>>>> RETURN ::aRecord[ nField ] :=3D Value
>>>> ENDIF
>>>>
>>>> WITH OBJECT ::oAdo
>>>> TRY
>>>> IF !( :Bof .OR. :Eof )
>>>> IF Value =3D=3D Nil
>>>> Value :=3D OLE_NULL
>>>> ENDIF
>>>> WITH OBJECT :Fields[ nField - 1 ]
>>>> IF lAnd( :Attributes, adFldUpdatable ) // =
>>>><<<<<<<<<<<<<<<<<<<<<<<< new
>>>> IF :Type =3D=3D adLongVarBinary .AND. lAnd( =
>>>>:Attributes, adFldLong )
>>>> :AppendChunk( VTArrayWrapper():New( 17, Value )
)
>>
>>> =
>>>>// 17 =3D VT_UI1 =3D byte
>>>> ELSE
>>>> Value :=3D :Value :=3D Value
>>>> ENDIF
>>>> ENDIF // <<<<<<<<<<<<<<<<<<<<<<<< new
>>>> END WITH
>>>> ENDIF
>>>> CATCH
>>>> ::Cancel()
>>>> ::NewADOError( "ADODB:RecordSet:FieldPut( '" + Ltrim( Str( =
>>>>nField ) ) + "' )" )
>>>> END
>>>> END WITH
>>>>
>>>>RETURN Value
>>>>
>>>>Regards,=20
>>>>
>>>>--=20
>>>>Ignacio Ortiz de Z=FA=F1iga
>>>>Xailer support / Soporte de Xailer
>>>>
http://www.xailer.com
>>>>
http://www.xailer.info
>>>>"Fabio" <
gianellini@coopservice.it> escribi=F3 en el mensaje =
>>>>news:4a5b525d$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>>>>>=20
>>>>> ok, perfect for datacontrols, but I have only datasource and dataset
>> =
>>>>and in
>>>>> theese object this property is not available
>>>>>=20
>>>>> Thank for your help
>>>>>=20
>>>>> "Ignacio Ortiz de Z=FA=F1iga" <
NoNameToAvoidSpam@xailer.com> wrote:
>>>>>>Fabio,
>>>>>>
>>>>>>With the latest redesign of Xailer datacontrols we decided that all
=
>>>>the
>>>>>=20
>>>>>>fields used in the query will be initialized to its default value on=20
>>>>>>AddNew() operations setting its lModified value to TRUE since we =
>>>>believe
>>>>> is=20
>>>>>>what almost all the xBase users expect to happen. But this =
>>>>simplification
>>>>>=20
>>>>>>may provoke a problem like yours.
>>>>>>
>>>>>>We have include a new property lAutoSave to all the DataControl to
=
>>>>avoid
>>>>> the=20
>>>>>>save on certain circunstances like yours. Just set this value to =
>>>>FALSE.
>>>>>>
>>>>>>Any feedback will be highly appreciated.
>>>>>>
>>>>>>Regards,
>>>>>>
>>>>>>--=20
>>>>>>Ignacio Ortiz de Z=FA=F1iga
>>>>>>Xailer support / Soporte de Xailer
>>>>>>
http://www.xailer.com
>>>>>>
http://www.xailer.info
>>>>>>"Fabio" <
gianellini@coopservice.it> escribi=F3 en el mensaje=20
>>>>>>news:4a5751ee$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>>>>>>>
>>>>>>> thank you for your answer but the problem is not solved
>>>>>>> i don't know if you can reproduce my situation, so i attach a
>>>>>>> little project containing this situation and a script to
>>>>>>> generate the table.
>>>>>>>
>>>>>>> Thank for your help
>>>>>>>
>>>>>>> "Jose F. Gimenez" <
jfgimenez@wanadoo.es> wrote:
>>>>>>>>Fabio,
>>>>>>>>
>>>>>>>>it that field is autoincremental, try to set it to NIL after calling
>>>>>>>>AddNew(), to allow the SQL engine to fill it.
>>>>>>>>
>>>>>>>>--=20
>>>>>>>>Regards,
>>>>>>>>
>>>>>>>>Jose F. Gimenez
>>>>>>>>
http://www.xailer.com
>>>>>>>>
http://www.xailer.info
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------ -----------=
>>>>---------
>>>>>>
>>>>>>
>>>>>>> Fabio=20
>>>>>>
>>>>>>
>>>>>=20
>>>>> Fabio
>>>>>
>>>>
>>>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>>>><HTML><HEAD>
>>>><META content=3D"text/html; charset=3Diso-8859-1" =
>>>>http-equiv=3DContent-Type>
>>>><META name=3DGENERATOR content=3D"MSHTML 8.00.6001.18783">
>>>><STYLE></STYLE>
>>>></HEAD>
>>>><BODY>
>>>><DIV><FONT size=3D2 face=3DArial>Fabio, </FONT></DIV>
>>>><DIV><FONT size=3D2 face=3DArial></FONT> </DIV>
>>>><DIV><FONT size=3D2 face=3DArial>Ok. You are certenly right. We have
=
>>>>already fixed=20
>>>>the problem. In case you can not wait until next release (this week)
you
>>>=
>>>>can=20
>>>>change the following on AdoRecords.prg:</FONT></DIV>
>>>><DIV><FONT size=3D2 face=3DArial></FONT> </DIV>
>>>><DIV><FONT color=3D#0000ff size=3D2 face=3D"Courier New">METHOD =
>>>>FieldPut( nField,=20
>>>>Value ) CLASS XAdoRecords</FONT></DIV>
>>>><DIV><FONT color=3D#0000ff size=3D2 face=3D"Courier =
>>>>New"></FONT> </DIV>
>>>><DIV><FONT color=3D#0000ff size=3D2 face=3D"Courier New"> IF=20
>>>>::lOnAppend<BR> RETURN ::aRecord[ nField ] =
>>>>:=3D=20
>>>>Value<BR> ENDIF</FONT></DIV>
>>>><DIV><FONT color=3D#0000ff size=3D2 face=3D"Courier =
>>>>New"></FONT> </DIV>
>>>><DIV><FONT color=3D#0000ff size=3D2 face=3D"Courier New"> =
>>>>WITH OBJECT=20
>>>>::oAdo<BR> =20
>>>>TRY<BR> IF !( :Bof .OR. =
>>>>:Eof=20
>>>>)<BR> =
>>>>IF Value=20
>>>>=3D=3D=20
>>>>Nil<BR> =
>>>> =20
>>>>Value :=3D=20
>>>>OLE_NULL<BR> &=
>>>>nbsp;=20
>>>>ENDIF<BR> &nbs=
>>>>p; WITH=20
>>>>OBJECT :Fields[ nField - 1=20
>>>>]<BR> &n=
>>>>bsp; =20
>>>>IF lAnd( :Attributes, adFldUpdatable ) //=20
>>>><<<<<<<<<<<<<<<<<<&=
>>>>lt;<<<<<=20
>>>>new<BR> =
>>>> =20
>>>>IF :Type =3D=3D adLongVarBinary .AND. lAnd( :Attributes, adFldLong=20
>>>>)<BR> &n=
>>>>bsp; =20
>>>>:AppendChunk( VTArrayWrapper():New( 17, Value ) ) // 17 =3D =
>>>>VT_UI1 =3D=20
>>>>byte<BR> =
>>>>; =20
>>>>ELSE<BR> =
>>>>; =20
>>>>Value :=3D :Value :=3D=20
>>>>Value<BR> &nbs=
>>>>p; =20
>>>>ENDIF<BR> &nbs=
>>>>p; =20
>>>>ENDIF //=20
>>>><<<<<<<<<<<<<<<<<<&=
>>>>lt;<<<<<=20
>>>>new<BR> =
>>>> END=20
>>>>WITH<BR> =20
>>>>ENDIF<BR> =20
>>>>CATCH<BR> =20
>>>>::Cancel()<BR> =
>>>>::NewADOError(=20
>>>>"ADODB:RecordSet:FieldPut( '" + Ltrim( Str( nField ) ) + "' )"=20
>>>>)<BR> END<BR> END =
>>>>WITH</FONT></DIV>
>>>><DIV><FONT color=3D#0000ff size=3D2 face=3D"Courier =
>>>>New"></FONT> </DIV>
>>>><DIV><FONT size=3D2 face=3D"Courier New"><FONT color=3D#0000ff>RETURN=20
>>>>Value</FONT><BR></FONT></DIV>
>>>><DIV><FONT size=3D2 face=3DArial>Regards, </FONT></DIV>
>>>><DIV><FONT size=3D2 face=3DArial></FONT><BR><FONT size=3D2 =
>>>>face=3DArial>-- <BR>Ignacio=20
>>>>Ortiz de Z=FA=F1iga<BR>Xailer support / Soporte de Xailer<BR></FONT><A=20
>>>>href=3D"http://www.xailer.com"><FONT size=3D2=20
>>>>face=3DArial>http://www.xailer.com</FONT></A><BR><A=20
>>>>href=3D"http://www.xailer.info"><FONT size=3D2=20
>>>>face=3DArial>http://www.xailer.info</FONT></A></DIV>
>>>><DIV><FONT size=3D2 face=3DArial>"Fabio" <</FONT><A=20
>>>>href=3D"mailto:
gianellini@coopservice.it"><FONT size=3D2=20
>>>>face=3DArial>
gianellini@coopservice.it</FONT></A><FONT size=3D2 =
>>>>face=3DArial>>=20
>>>>escribi=F3 en el mensaje </FONT><A =
>>>>href=3D"news:4a5b525d$[email=1@svctag-j7w3v3j]1@svctag-j7w3v3j[/email]"><FONT=20
>>>>size=3D2 face=3DArial>news:4a5b525d$[email=1@svctag-j7w3v3j]1@svctag-j7w3v3j[/email]</FONT></A><FONT
=
>>>>size=3D2=20
>>>>face=3DArial>....</FONT></DIV><FONT size=3D2 face=3DArial>> <BR>> =
>>>>ok, perfect=20
>>>>for datacontrols, but I have only datasource and dataset and in<BR>>
=
>>>>theese=20
>>>>object this property is not available<BR>> <BR>> Thank for your=20
>>>>help<BR>> <BR>> "Ignacio Ortiz de Z=FA=F1iga" <</FONT><A=20
>>>>href=3D"mailto:
NoNameToAvoidSpam@xailer.com"><FONT size=3D2=20
>>>>face=3DArial>
NoNameToAvoidSpam@xailer.com</FONT></A><FONT size=3D2 =
>>>>face=3DArial>>=20
>>>>wrote:<BR>>>Fabio,<BR>>><BR>>>With the latest redesign =
>>>>of=20
>>>>Xailer datacontrols we decided that all the<BR>> <BR>>>fields =
>>>>used in=20
>>>>the query will be initialized to its default value on =
>>>><BR>>>AddNew()=20
>>>>operations setting its lModified value to TRUE since we believe<BR>>
=
>>>>is=20
>>>><BR>>>what almost all the xBase users expect to happen. But this=20
>>>>simplification<BR>> <BR>>>may provoke a problem like=20
>>>>yours.<BR>>><BR>>>We have include a new property lAutoSave =
>>>>to all=20
>>>>the DataControl to avoid<BR>> the <BR>>>save on certain =
>>>>circunstances=20
>>>>like yours. Just set this value to FALSE.<BR>>><BR>>>Any =
>>>>feedback=20
>>>>will be highly=20
>>>>appreciated.<BR>>><BR>>>Regards,<BR>>><BR>>>--=20
>>>><BR>>>Ignacio Ortiz de Z=FA=F1iga<BR>>>Xailer support / =
>>>>Soporte de=20
>>>>Xailer<BR>>>http://www.xailer.com<BR>>>http://www.xailer.info=
>>>><BR>>>"Fabio"=20
>>>><</FONT><A href=3D"mailto:
gianellini@coopservice.it"><FONT size=3D2=20
>>>>face=3DArial>
gianellini@coopservice.it</FONT></A><FONT size=3D2 =
>>>>face=3DArial>>=20
>>>>escribi=F3 en el mensaje=20
>>>><BR>>>news:4a5751ee$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]<BR>>>><BR>>>=
>>>>;>=20
>>>>thank you for your answer but the problem is not solved<BR>>>> =
>>>>i don't=20
>>>>know if you can reproduce my situation, so i attach a<BR>>>> =
>>>>little=20
>>>>project containing this situation and a script to<BR>>>> =
>>>>generate the=20
>>>>table.<BR>>>><BR>>>> Thank for your=20
>>>>help<BR>>>><BR>>>> "Jose F. Gimenez"=20
>>>><
jfgimenez@wanadoo.es>=20
>>>>wrote:<BR>>>>>Fabio,<BR>>>>><BR>>>>>i=
>>>>t that=20
>>>>field is autoincremental, try to set it to NIL after=20
>>>>calling<BR>>>>>AddNew(), to allow the SQL engine to fill=20
>>>>it.<BR>>>>><BR>>>>>--=20
>>>><BR>>>>>Regards,<BR>>>>><BR>>>>>Jose =
>>>>F.=20
>>>>Gimenez<BR>>>>>http://www.xailer.com<BR>>>>>http:=
>>>>//www.xailer.info<BR>>>>><BR>>>>><BR>>>>=
>>>><BR>>><BR>>><BR>>>-------------------------------------=
>>>>-------------------------------------------<BR>>><BR>> ><BR>&g=
>>>>t;>>=20
>>>>Fabio <BR>>><BR>>><BR>> <BR>>=20
>>>>Fabio<BR>></FONT></BODY></HTML>
>>>>
>>>>
>>>
>>>Fabio
>>
>
>
>
>> Fabio
>
Fabio