Results 1 to 2 of 2
2002-04-03, 09:39 #1
- Join Date
- Sep 2001
- Thanked 0 Times in 0 Posts
ADO problem - 'Mutliple-Step OLE DB'... (ADO 2.5, 2.6)
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.
2002-04-03, 10:16 #2
- Join Date
- Dec 2000
- Burwash, East Sussex, United Kingdom
- Thanked 191 Times in 177 Posts
Re: ADO problem - 'Mutliple-Step OLE DB'... (ADO 2.5, 2.6)
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,
Microsoft MVP - Excel