Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Sep 2001
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ADO problem - 'Mutliple-Step OLE DB'... (ADO 2.5, 2.6)

    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

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: ADO problem - 'Mutliple-Step OLE DB'... (ADO 2.5, 2.6)

    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 <!post=here,129712>here<!/post>.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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