Re: Update problem ADO vbnet 2005

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Agreed, Cor...but to paraphrase Bill Clinton, "It depends on what the
meaning of 'doesn't work' is." I for one am interested to find out. :-)


Cor Ligthert [MVP] wrote:
Adm,

But than he should in my opinion get an error instead of non updating.

Cor

<admspam@xxxxxxxxx> schreef in bericht
news:1154974685.512842.157300@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
just for fun, let me take a wild guess and suggest that this is perhaps
due to optimistic record locking.

scotty, before executing the .Update command, determine what the SQL
text of the command is. See if the 'WHERE' clause is really long and
includes every one of the fields in your table. In such cases, the
Where clause is so specific that it fails to find the record to update,
thus triggering an error much of the time. If this is the case, perhaps
you can simplify that command by including only the primary key in the
Where clause. This might introduce some concurrency issues (i.e., last
one in will always win), but it may also resolve your error.

If this isn't the situation and my shot in the dark missed the mark,
please post more details on the error and your code.

adm

Scotty wrote:
Hi Cor,

Thanks for willing help me,
This evening (Belgium time)I will send you more info about my code

Best regards

Marc,
Action-Data



"Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx> schreef in bericht
news:O9p1K4fuGHA.5084@xxxxxxxxxxxxxxxxxxxxxxx
Marc,

A sample would not help you there are millions of sample on Internet,
can
you show the code where you do the update.

Cor


"Action-Data" <Marc@xxxxxxxxxxxxxxx> schreef in bericht
news:%23wVUGyeuGHA.5056@xxxxxxxxxxxxxxxxxxxxxxx
Hi Cor,

Thanks for answering,
I don't have any adea why it does not work sometimes

The connection is coded in ADO (I did not use the grafical way)
Do you have a good sample for me?

Many thanks in advance,
Marc.





"Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx> schreef in bericht
news:OvhwOnduGHA.3364@xxxxxxxxxxxxxxxxxxxxxxx
Can you tell why it "Sometimes doesnt work?, in other words does it
gives no others or what does not work.

Cor

"Scotty" <xxxxx2@xxxxxxxxxx> schreef in bericht
news:utIvT3UuGHA.1296@xxxxxxxxxxxxxxxxxxxxxxx
I like to have a good insert, update and delete code
The code below sometimes workl ok sometimes doesnt work, what i am
doing wrong??


Sub SaveAny()


Dim command_builder As New
OleDb.OleDbCommandBuilder(daOrders)
' Save any changes.
daOrders.Update(dsOrders, "tblOrders")


End Sub


Thanks for helping

Marc.










.



Relevant Pages

  • Re: Update problem ADO vbnet 2005
    ... due to optimistic record locking. ... scotty, before executing the .Update command, determine what the SQL ... text of the command is. ... Where clause is so specific that it fails to find the record to update, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Update problem ADO vbnet 2005
    ... due to optimistic record locking. ... scotty, before executing the .Update command, determine what the SQL ... text of the command is. ... Where clause is so specific that it fails to find the record to update, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Limit on Access where clause?
    ... Microsoft Access query specifications Attribute Maximum ... Number of characters in a cell in the query design grid 1024 ... Access had a limit of 99 fields in the where clause. ... a select command that retrieves rows to a OleDbDataAdapter dataset? ...
    (microsoft.public.dotnet.languages.vb)
  • Armstrong lauds another spaceman
    ... Neil Armstrong, in a very rare public appearance, said the following ... recent "Star Trek" fete honoring Jimmy "Scotty" Doohan... ... When I get that command, I would like to have a ... I am an engineer. ...
    (sci.space.history)
  • Re: Question about replace and _tally
    ... but it also returns the totat reccount. ... It seems if you do not use a function in the replace clause it returns the ... > command using _TALLY, but I am getting unexpected results. ... > me" $ MyField ...
    (microsoft.public.fox.programmer.exchange)