VBA mysql SELECT MD5(tel)

jarmil

New Member
Joined
Mar 21, 2020
Messages
2
Office Version
2007
Platform
Windows
Hello,

I've got problem. I receive phone number hashed by MD5 (00037b319ddf1495b2e7ae64e29a8ef5). I need to get this number from our mysql database.
So mysql query is: SELECT MD5(c.mob) phone, c.mob phone1 FROM db_hu.hu_cust c WHERE MD5(c.mob) IN ('00f9758dd73300b4025ea916c8a3e024');

I should receive result:
1584822038556.png


But if I read recordset then result is ???????????????? 36202601806:
rs.Open strSql, conn
Do While Not rs.EOF
Debug.Print CStr(rs!phone) & " " & CStr(rs!phone1) ' --> this returns ???????????????? 36202601806 instead of ???????????????? 36202601806
rs.MoveNext
Loop

Have anybody idea how to get 00037b319ddf1495b2e7ae64e29a8ef5 instead of question marks?

Thank you!
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,294
Office Version
2019, 2016, 2013
Platform
Windows
can you add an apostrophe before ensuring it is returned as text
 

jarmil

New Member
Joined
Mar 21, 2020
Messages
2
Office Version
2007
Platform
Windows
can you add an apostrophe before ensuring it is returned as text
Thank you for your help. I tried but it doesn't work for me. I found a solution:
SELECT CAST(MD5(c.mob) AS CHAR) phone, c.mob phone1 FROM db_hu.hu_cust c WHERE MD5(c.mob) IN ('00f9758dd73300b4025ea916c8a3e024');
Result is: 00037b319ddf1495b2e7ae64e29a8ef5 36202601806
 

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,294
Office Version
2019, 2016, 2013
Platform
Windows
do you use the hash for anything as each obviously will be the same ? in which case c,mob phone1 would be the only output, just curious
 

Watch MrExcel Video

Forum statistics

Threads
1,095,687
Messages
5,445,952
Members
405,372
Latest member
Vithanalas

This Week's Hot Topics

Top