VBA mysql SELECT MD5(tel)

jarmil

New Member
Joined
Mar 21, 2020
Messages
2
Office Version
  1. 2007
Platform
  1. 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!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
can you add an apostrophe before ensuring it is returned as text
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,223,881
Messages
6,175,159
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top