PDA

View Full Version : MySQL gives strange characers.


Morgoth
06-14-2005, 10:55 AM
I don't really have any code to post, except for the connection code to the MySQL Database.

Set CpoConn = Server.CreateObject("ADODB.Connection")
StrCpConn = "Driver=MySQL ODBC 3.51 Driver;Server=88.88.88.88;UID=Username;PWD=password;Database=database;"
'StrCpConn = "Driver=MySql;Server=88.88.88.88;UID=Username;PWD=password;Database=database;"
CpoConn.open StrCpConn


This is pretty standard code, so I don't think the problem lies here.

This code works fine for the MySQL 3.23.53 server I have running on the same box as the IIS server. But this code gives me strange results from my database on the remote MySQL 4.0.24 server I use.
Here is the current contents of the database:
http://www.morgoth.sonnexh.com/
That script is written in PHP.

I have the same php code running on my local IIS server, and it works fine, but when I use ASP code to access the remote MySQL server, it gives me strange strings; However, I don't think they are actually strings.


<%
Do While Not oRS.EOF
If IntEOF < IntMaxLines Then
'Response.Write "> " & cpoRS("Comment") & "<br>"
Response.Write cpoRS("Comment")
Response.Write "<br>"
oRS.MoveNext
Else
Exit Do
End If
IntEOF = IntEOF + 1
Loop
%>

(Starting at "No end script if people forget to add the end tag. Adding it soon.")

??????4??????????????????????????
?????>
?????????
?s
???5????4???????????????????????????????
?????????????????????;
?????m
?????????????????????>
???????
?????????????????????!
?????????
?
?
???????????????????
?????n
?????????????????????
??????


If I use the code that I commented out, above, I get the error:

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/cp/MySQL-asp/default.asp, line 153

Which makes me wonder if the strings I pulled out are actual strings.

So I am wondering if anyone can give me any insight as to what is going on here, and possibly an answer to how I might be able to fix it?