• ADO problem – ‘Mutliple-Step OLE DB’… (ADO 2.5, 2.6)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » ADO problem – ‘Mutliple-Step OLE DB’… (ADO 2.5, 2.6)

    • This topic has 1 reply, 2 voices, and was last updated 23 years ago.
    Author
    Topic
    #369073

    Hi All,

    I have asked this question in VB/VBA as well. I get a problem when I run a select statement against a sybase database from VBA/ASP. The problem appears when the select contains an or, ie. “select deal_nr from fxcash where deal_nr = 10090 or deal_nr = -10090”

    If I dont include the or, the code works fine. If I include the or, i get the following error:

    Microsoft OLE DB Provider for ODBC Drivers error ‘80040e21’
    Microsoft OLE DB Provider operation generated errors. Check OLE DB status value, if available. No work was done.

    I checked the knowledge base and it says this can happen when OLEDB_SERVICES flag is missing from the registry, but this is there on my machine.

    Again, if I remove the or, the code works fine.

    Does anyone have any ideas?

    Thanks for your help.

    Regards

    Al

    Viewing 0 reply threads
    Author
    Replies
    • #580151

      Hi,
      Does it help if you put “where deal_nr = 10090 or where deal_nr = -10090”? (You could also use “Where abs(deal_nr) = 10090” or “where deal_nr in (10090, -10090)” I think.)

      I’m going to lock this thread as it’s not strictly an Access question so I think any answers should be posted in the VBA forum here.

    Viewing 0 reply threads
    Reply To: ADO problem – ‘Mutliple-Step OLE DB’… (ADO 2.5, 2.6)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: