LPurvis
AWF VIP
- Local time
- Today, 09:57
- Joined
- Jun 16, 2008
- Messages
- 1,269
Chr returns the string character based upon the passed ASCII character code.
ASC does the reverse. Hex returns the Hex value of a passed Long.
The Hex representation of a character is therefore
Hex(Asc(strChar))
The thing to bear in mind about ADO (compared to the more traditional/predictable data access with DAO) is that it is entirely dependent upon the provider for its functionality (and yes - even its behaviour).
The example page you've found there is using the Active Directory Provider and as such it obeys its own set of standards - even when in SQL mode (which that page isn't dealing with).
ADO with the Jet and SQL Server providers does allow the escaping of special characters (I believe I mentioned it earlier?). It's entirely possible by creating a character class [].
e.g.
WHERE FieldName Like '%[%]%'
returns rows with an actual % symbol in.
Obviously that doesn't help with your quotes though.
The quotes here are delimiters. They signal the end of the string. AFAIK nothing, other than doubling up, will escape that meaning.
However - I still don't see why this is happening in the first place.
Testing myself the suggested code works against a Jet, Linked SQL table, linked SQL view and direct ADO connection to SQL Server.
I can't think offhand what, in your code, might be causing the issue.
Can you show your full code and table anyway?
The only thing I notice in your code is that you're requesting a Keyset cursor type - but will be getting a Static due to your cursor location. (But then that's just from some sloppy/rushed example code knocked together for the original example in the first place... whoever put that together ;-)
It shouldn't be affecting anything at all though.
All that said - the change you've made is actually in line with my actual recommendation in my first post here. So that's good.
I too just hate to leave something unsolved.
Cheers.
ASC does the reverse. Hex returns the Hex value of a passed Long.
The Hex representation of a character is therefore
Hex(Asc(strChar))
The thing to bear in mind about ADO (compared to the more traditional/predictable data access with DAO) is that it is entirely dependent upon the provider for its functionality (and yes - even its behaviour).
The example page you've found there is using the Active Directory Provider and as such it obeys its own set of standards - even when in SQL mode (which that page isn't dealing with).
ADO with the Jet and SQL Server providers does allow the escaping of special characters (I believe I mentioned it earlier?). It's entirely possible by creating a character class [].
e.g.
WHERE FieldName Like '%[%]%'
returns rows with an actual % symbol in.
Obviously that doesn't help with your quotes though.
The quotes here are delimiters. They signal the end of the string. AFAIK nothing, other than doubling up, will escape that meaning.
However - I still don't see why this is happening in the first place.
Testing myself the suggested code works against a Jet, Linked SQL table, linked SQL view and direct ADO connection to SQL Server.
I can't think offhand what, in your code, might be causing the issue.
Can you show your full code and table anyway?
The only thing I notice in your code is that you're requesting a Keyset cursor type - but will be getting a Static due to your cursor location. (But then that's just from some sloppy/rushed example code knocked together for the original example in the first place... whoever put that together ;-)
It shouldn't be affecting anything at all though.
All that said - the change you've made is actually in line with my actual recommendation in my first post here. So that's good.
I too just hate to leave something unsolved.
Cheers.