We help IT Professionals succeed at work.
Get Started

Mysql query fails only when I use MD5(id)

trg_dk
trg_dk asked
on
568 Views
Last Modified: 2012-05-05
Hi.
Just moved a site to a new hosting provider. Suddenly all pages that use md5(id) in the query fails with the following error :

Microsoft VBScript runtime  error '800a000d'
Type mismatch
/firebee_test.asp, line 21

Please see my attached script - I can't really make a more simple example.
The script only fails in the MD5 scenario.

Hosting is a Windows 2003, fully patched. IIS6.

Any ideas, hints, tests, well almost anything goes. Please help me out here :-(

Cheers,
Mark


<%
Session.LCID = 1030
dbsetup = "Driver={MySQL ODBC 3.51 Driver}; Server=xxx; Port=3306; Option=131072; Stmt=; Database=xxx;uid=xxx; pwd=xxx;"
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.Open dbsetup
 
If request.querystring("md5") = "true" Then
	sql = "SELECT md5(id), varenavn FROM produkter ORDER BY id;"
Else
	sql = "SELECT id, varenavn FROM produkter ORDER BY id;"
End If
 
Set rs = dbConn.Execute( sql )
if not (rs.bof OR rs.eof) Then
	arrVarer = rs.getrows
End if
Response.write "<a href='?md5=false'>UDEN md5 (SQL = SELECT id, varenavn FROM produkter ORDER BY id;)</a><br/><a href='?md5=true'>MED md5 (SQL = SELECT md5(id), varenavn FROM produkter ORDER BY id;)</a><br/><br/>"
Response.write "<table width='300' border='1'><tr><td>ID</td><td>Varenavn</td></tr>"
if UBound(arrVarer,2) > 0 Then
	For i = 0 TO Ubound(arrVarer,2)
		Response.write "<tr><td>"& arrVarer(0,i) &"</td><td>"& arrVarer(1,i) &"</td></tr>"& vbCrLf
	Next
End if
Response.write "</table>"
%>

Open in new window

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 23 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE