Re: 0x800a0cb3 when Update record
- From: Anders Eriksson <andis59@xxxxxxxxx>
- Date: Thu, 16 Oct 2008 17:20:07 +0200
Hello Bob,
On Thu, 16 Oct 2008 10:13:51 -0400, Bob Barrows [MVP] wrote:
The error message is:On Wed, 15 Oct 2008 10:54:45 -0400, Bob Barrows [MVP] wrote:I've reset the newsgroup in my client so I now have your original message. I
Anders Eriksson wrote:
By coincident I changed the cursor type from adUseServer to
asUseClient and then the update worked!
don't do C++ so bear with me. What I can interpret leads to some questions:
What is the error description? Different providers may have different error
messages for the same error code.
What does the sql variable contain?The sql variable contains this:
sql.Format(_T("SELECT
ST.OrderNr,ST.Version,ST.Verkstad,ST.Laser,ST.Producerad,ST.Prioritet ")
_T("FROM Orders ST ")
_T("INNER JOIN ")
_T("(SELECT OrderNr,MAX(Version) AS Version ")
_T("FROM Orders GROUP BY OrderNr) ST2 ON ST.OrderNr = ST2.OrderNr AND
ST.Version = ST2.Version ")
_T("WHERE (ST.Laser=%d OR ST.Laser=0 OR ST.Laser IS NULL) AND((NOT
(ST.Producerad=-1)) OR (ST.Producerad IS NULL)) AND (Stoppad=0) AND
(ST.FelKod=0) AND(NOT (ST.Verkstad='MAN')) ")
_T("ORDER BY ST.Prioritet DESC,ST.Tid,ST.OrderIndex"),m_laserId);
Why are you using adCmdUnknown instead of adCmdText?Just a misstake, I have changed it in my code
You should test the LockType and CursorType properties after opening the
recordset to verify that the provider was able to give you the types you
requested.
I have done that now, CursorType=adOpenForwardOnly and LockType=adReadOnly.
So it has not changed from the default values.
Do I need any specific rights in the database to be able to lock it?
Are you sure you need adLockPessimistic? Most experts advise against usingI think I need it ;-) In the database is a queue of orders, I have multiple
that lock type except in extreme circumstances. In this case you are using
an explicit transaction, so that lock type is probably not needed at all.
programs that work the queue and each program will take the first record
that has not been work on, flag it as working and then continue working
until the record is done. I have tried this with an Optimistic locking but
then I got the same record working in multiple programs.
As to ADO transactions not working with client-side cursors, I believe theAha, You need to read the header also ;-)
only case where this is true is with RDS, which you are not using.
However, as Ralph mentioned, you would probably be better off using anI don't get how to create an sql statement that performs an UPDATE as well
UPDATE sql statement to perform this update rather than a recordset.
as returning a couple of column values within a transaction...
For this project I can live with a client cursor, but since I forsee that
I'm going to need to be able to update a record using server cursor I would
appreciate an answer...
TIA
// Anders
--
English is not my first, or second, language
so anything strange, or insulting, is due to
the translation.
Please correct me so I may improve my English!
.
- Follow-Ups:
- Re: 0x800a0cb3 when Update record
- From: Bob Barrows [MVP]
- Re: 0x800a0cb3 when Update record
- References:
- 0x800a0cb3 when Update record
- From: Anders Eriksson
- Re: 0x800a0cb3 when Update record
- From: Ralph
- Re: 0x800a0cb3 when Update record
- From: Anders Eriksson
- Re: 0x800a0cb3 when Update record
- From: Anders Eriksson
- Re: 0x800a0cb3 when Update record
- From: Bob Barrows [MVP]
- Re: 0x800a0cb3 when Update record
- From: Anders Eriksson
- Re: 0x800a0cb3 when Update record
- From: Bob Barrows [MVP]
- 0x800a0cb3 when Update record
- Prev by Date: Re: 0x800a0cb3 when Update record
- Next by Date: Re: 0x800a0cb3 when Update record
- Previous by thread: Re: 0x800a0cb3 when Update record
- Next by thread: Re: 0x800a0cb3 when Update record
- Index(es):
Relevant Pages
|