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

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » ADO problem – ‘Mutliple-Step OLE DB’… (ADO 2.5, 2.6)

    • This topic has 4 replies, 3 voices, and was last updated 23 years ago.
    Author
    Topic
    #369072

    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)” ?

    Viewing 1 reply thread
    Author
    Replies
    • #580149

      Hi HansV,

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

      Regards

      Al

      • #580152

        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))”?

        • #580160

          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.

    • #580147

      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! brickwall

      Does anyone have any ideas?

      Thanks for your help.

      Regards

      Al

    Viewing 1 reply thread
    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: