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)” ?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » 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.
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!
Does anyone have any ideas?
Thanks for your help.
Regards
Al
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications