<p>asp连接mysql代码<br />
asp连接mysql之前须安装aMyODB<br />
下载地址<br />
<a href="http://www.skycn.com/soft/2141.html" target="new">http://www.skycn.com/soft/2141.html</a><br />
<br />
<%<br />
str = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=database;<br />
<br />
UID=username;PASSWORD=password; OPTION=3"<br />
set conn=server.CreateObject("adodb.Connection")<br />
conn.open str<br />
<br />
set rs=server.CreateObject("adodb.Recordset")<br />
sql="select * from seocninfo"<br />
rs.open sql,conn,1,1<br />
<br />
%><br />
一般中文都会乱码<br />
乱码解决方法<br />
conn.Execute("SET NAMES 'gb2312'")</p>