Re: MD5 Hash with single quote = grief in dao.findfirst
From: Stephen Rasey (raseysm_at_wiserways.com)
Date: 08/17/04
- Next message: Cheval: "Send Object not returning error"
- Previous message: Dirk Goldgar: "Re: Folder"
- In reply to: david epsom dot com dot au: "Re: MD5 Hash with single quote = grief in dao.findfirst"
- Next in thread: david epsom dot com dot au: "Re: MD5 Hash with single quote = grief in dao.findfirst"
- Reply: david epsom dot com dot au: "Re: MD5 Hash with single quote = grief in dao.findfirst"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 16 Aug 2004 23:53:00 -0500
No
Option Compare Binary
was not the solution. Binary is the default anyway. It tried the Sub
TestH70Ado using an Option Compare Text and it did not help.
I could not use Option Compare Database. Odd, huh? 'Compare Database' is
only available from Access according to the help.
I am doing all this from Excel VBA. I have the Access 11.0 library
referenced, but it still will not take Option Compare Database. I doubt my
problem is caused by running DAO.recordset from excel. If it is, then it
certainly is a bug.
I have the ADO working. I have always prefered DAO (simpler setups), but I
guess I'll have to prefer ADO of DAO if I can't trust DAO.
Stephen Rasey
WiserWays
Houston
http://excelsig.org
Sub TestH70Ado()
H02_Define_H_Recordsets
Dim strH As String
Dim ID As Long
ID = H70Check("$¥¨3¶¯ô¼.Ë©£F³Ñ") 'Answer is -1915054114 works
ID = H70CheckADO("$¥¨3¶¯ô¼.Ë©£F³Ñ") 'Answer is -1915054114 works
ID = H70Check("-s3ë='[+@û;ÒëN") 'Answer is supposed to be
1106461086, returns 0
ID = H70CheckADO("-s3ë='[+@û;ÒëN") 'Answer is 1106461086 works.
End Sub
Function H70Check(strHash As String) As Long
'return the IDHashProspSched if the strHash is found in
H70HashProspSched
'return 0 if not found. Protect against 0 being a legitimate ID.
Dim sql As String
sql = "HASH = '" & wwQuoteFix(strHash) & "'" 'Rasey 040804 v24j
With rsH70ProspSched
.Requery
.MoveFirst 'rasey 040813 test
.FindFirst sql
If .NoMatch Then
H70Check = 0
Else
H70Check = !IDHashProspSched
End If
End With
End Function
Function H70CheckADO(strHash As String) As Long
'return the IDHashProspSched if the strHash is found in
H70HashProspSched
'return 0 if not found. Protect against 0 being a legitimate ID.
Dim sql As String
sql = "HASH = '" & wwQuoteFix(strHash) & "'" 'Rasey 040804 v24j
With adorsH70
.Requery
.MoveFirst 'With ADO, to do a find first, you must do a
MoveFirst, then Find.
.Find sql
If .EOF Then
H70CheckADO = 0
Else
H70CheckADO = !IDHashProspSched
End If
End With
End Function
Function wwQuoteFix(str1 As String) As String
wwQuoteFix = Replace(str1, "'", "''")
End Function
"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:evZT1U0gEHA.1184@TK2MSFTNGP12.phx.gbl...
> FWIW, I don't have any problem with "single quotes' in
> DAO.findfirst, in Access 2000 or A97.
>
> Two thoughts:
> 1) You haven't set Option Compare Binary at the top of the code module?
>
> 2) If you check using AscW() instead of Asc() do you see anything
different?
>
> (david)
>
- Next message: Cheval: "Send Object not returning error"
- Previous message: Dirk Goldgar: "Re: Folder"
- In reply to: david epsom dot com dot au: "Re: MD5 Hash with single quote = grief in dao.findfirst"
- Next in thread: david epsom dot com dot au: "Re: MD5 Hash with single quote = grief in dao.findfirst"
- Reply: david epsom dot com dot au: "Re: MD5 Hash with single quote = grief in dao.findfirst"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|