Re: 0x800a0cb3 when Update record



On Thu, 16 Oct 2008 13:00:50 -0400, Bob Barrows [MVP] wrote:

Anders Eriksson wrote:
What is the error description? Different
providers may have different error messages for the same error code.
The error message is:

It's blank?

No, I had to take the phone and when that was done I didn't remember that I
hadn't entered the error message and just sent it.
The error message is:
"Unknown error 0x800A0CB3"

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);

:-)
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++.

The sql variable contains the sql statements that are in the Format. Since
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, I
believe the only case where this is true is with RDS, which you are
not using.

Aha, You need to read the header also ;-)

Why?


I missed the header that says Remote Data Service and I tried to be funny,
which obviously didn't work...


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.

Can you recommend some URLs for teaching how to create stored procedures?
// 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!
.



Relevant Pages

  • cannot convert between unicode and non-unicode string data types
    ... Cindy, I have the same problem, there is a solution, In the OLE DB Destination component, in the Mappings option in the input column you must choose the Data Conversion., and that's it. ... I am converting a simple (at least in the SQL Server 2000 DTS days) to this ... error message stays the same ... numerous times I have inserted the transformation task between the oracle ...
    (microsoft.public.sqlserver.dts)
  • Re: SQL Timeout Error
    ... "Robert Lakinski" wrote: ... but you can access data in Sql server via MS ... I don't know why I got the error message. ...
    (microsoft.public.sqlserver.server)
  • Re: Multilingual versions of SQL Express 2005 available ? Where ?
    ... The error code alone is not sufficient. ... error code which is represented in the parameters used to format the SQL ... language is used. ... > we may consider provide localized error message according to the error ...
    (microsoft.public.sqlserver.setup)
  • Re: cannot convert between unicode and non-unicode data types
    ... product can't actually produce a meaningful error message. ... oracle and the sql database. ... Tried dumping to a raw file but the output is still unicode when I try to ...
    (microsoft.public.sqlserver.dts)
  • Re: update query ODBC--call failed
    ... Google results from searching for your error message, ... on the local server SQL database. ... reporting the error rather than the "ODbc Driver For SQL Server" ...
    (microsoft.public.access.queries)

Loading