Results 1 to 5 of 5
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

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

    Just a long shot. Does it help if you put brackets around each of the conditions, i.e.

    "... where (deal_nr = 10090) or (deal_nr = -10090)" ?

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

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

    Hi HansV,

    Thanks for the quick reply, but unfortunately it makes no difference.

    Regards

    Al

  3. #3
    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 get a problem when I run a select statement against a sybase database from VB/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. It appears that ADO is splitting the statement into two parts. Also, I should have mentioned - I create the ado connection DSN less. If i specify a DSN this works! <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

    Does anyone have any ideas?

    Thanks for your help.

    Regards

    Al

  4. #4
    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,
    In addition to the response I posted in the Access forum (I'm going to lock that thread and link it to this one to prevent any confusion), does this work:
    where ((deal_nr = 10090) or (deal_nr = -10090))"?
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    New Lounger
    Join Date
    Sep 2001
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Hi Rory,

    No, the brackets dont appear to make a difference. I could use the abs() you suggested, but the column is the leading column on an index in a large table, and putting a function on the column will force a table scan.

    I am certain this issue pertains to using an ODBC driver with OLE DB - and for some reason it is being split. It is certainly more bizarre, that if I use the connection via a DSN it works! It has to be something that is happening with the DSN less connection.

Posting Permissions

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