Re: 0x800a0cb3 when Update record
- From: Anders Eriksson <andis59@xxxxxxxxx>
- Date: Fri, 17 Oct 2008 11:22:57 +0200
On Thu, 16 Oct 2008 13:00:50 -0400, Bob Barrows [MVP] wrote:
Anders Eriksson wrote:No, I had to take the phone and when that was done I didn't remember that I
What is the error description? DifferentThe error message is:
providers may have different error messages for the same error code.
It's blank?
hadn't entered the error message and just sent it.
The error message is:
"Unknown error 0x800A0CB3"
The sql variable contains the sql statements that are in the Format. SinceWhat 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);
:-)
I did not ask how you defined the variable: I asked what it _contained_. Two
different things. Again, I don't do C++ but what I was asking for was the
result of
Write(sql)
or however you would do that in C++.
I'm lazy I didn't remove the _T( but it should be clear what the SQL
statement are...
Well, your recordset is based on a join which may or may not make it
updatable. The fact that it is successful with a client-side static cursor
leads me to believe that the join has nothing to do with your problem
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.
That means you have asked for incompatible settings. I really see nothing
that should lead to that incompatability. Where's Bill Vaughn when you need
him?
Maybe the join is the problem after all ... I'm just guessing here. You may
want to play with the "Unique Table" dynamic property of the recordset
object. I've never had to use it myself (preferring to use DML for data
modifications rather than recordsets) but there is documentation for it.
I have now tested a bit more and there seem to be something really strange
going on.
When I set CursorLocation=adUserServer
I allways get CursorType=adOpenForwardOnly and LockType=adReadOnly
If I change CursorLocation=asUseClient
I allways get CursorType=adOpenStatic and LockType=adLockBatchOptimistic
What the ?
As to ADO transactions not working with client-side cursors, IAha, You need to read the header also ;-)
believe the only case where this is true is with RDS, which you are
not using.
Why?
I missed the header that says Remote Data Service and I tried to be funny,
which obviously didn't work...
Can you recommend some URLs for teaching how to create stored procedures?
That's a job for a stored procedure with some output parameters.
Seriously, let SQL Server take care of your transactions for you: create a
stored procedure that accepts some input values, does all the processing in
the database, and returns the output values to your application. Instead of
output values, you could have it return a resultset if multiple rows of
output data are needed.
// 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]
- 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
|
Loading