Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004

    Unanswered: ADO Objects, Get "OLE error 80040E21" when posting.

    I am using Delphi and am in the process of replacing the BDE objects with ADO. I am using the XTG Systems ODBC driver. There is no sorce code because I am using all objects (TDBGrig, TDBNavigator linked to a TADOQuery wich is using a TADOConnection). I can however give you my connection string, because I think my problem lys within...

    User ID=sysdba;
    Data Source=FBWord;
    Extended Properties="DSN=FBWord;UID=sysdba;PWD=masterkey;;; "

    Ok, my problem is that when ever I make a change in the grid and try to post using the Navigator, I get an "OLE error 80040E21".

    I tryed searching for what the possible problems are and most people say that I am trying to put in information that is wider than my column. If I was not trying to edit in a DBGrid I would look at it but being that I am editing not inserting and I am not doing it through code rather a component, I can not see how this is.

    Others have said that it is how I am connected so I have been trying to mess with my connection string and TADOQuer and TADOConnection properties for the last two days and there are so many different settings that it would take me forever to try all of them. If some one could help me out I would very much appriciate it.

    Her are my settings on the TADOConnection...

    xaCommitRetaining = True
    xaAbortRetaining = False
    CommandTimeout = 30
    Connected = True
    ConnectionString = {See Above}
    ConnectionTimeout = 15
    ConnectionOptions = coConnectUnspecified
    ConnectionLocation = clUseClient
    DefaultDatabase = {Null}
    IsolationLevel = ilReadCommitted
    KeepConnection = True
    LoginPrompt = False
    Mode = cmReadWrite
    Name = ADOConnection1
    Provider = MSDASQL.1
    Tag = 0

    I know that my IsolationLevel and Mode are set for optimal performance, but at this point I was trying anything to get it to work. It does work if I use BDE components but I am trying to get away from the BDE.

    Thanks for any input.


    Just an update on this problem...

    Things I have tryed are....

    Updateing using the FireBird ODBC instead of XTG Systems.
    Updateing My MDAC.

    I have found that when setting my "modes" equal to "Share Exclusive" (so that I can do the equivalent to a request live) in my connection string and try to to connect, I get the same error. It as if the ODBC will not let me record lock the database for updates.

    So, I went off and try to do the record locking at the ADOQuery by setting the Cursor Type to ctDynamic but every time I open the ADOQuery it automatically resets back to ctStatic.

    Can any one tell me why this is happening and how to prevent it?

  2. #2
    Join Date
    Apr 2004

    Update to the Problem

    I got rid of the error byt setting the Lock Type to "ltBatchOptimistic". The only problem now is that none of my posts are commiting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts