asp连接mysql数据库代码

<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 /> &lt;%<br /> str = &quot;DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=database;<br /> <br /> UID=username;PASSWORD=password; OPTION=3&quot;<br /> set conn=server.CreateObject(&quot;adodb.Connection&quot;)<br /> conn.open str<br /> <br /> set rs=server.CreateObject(&quot;adodb.Recordset&quot;)<br /> sql=&quot;select * from seocninfo&quot;<br /> rs.open sql,conn,1,1<br /> <br /> %&gt;<br /> 一般中文都会乱码<br /> 乱码解决方法<br /> conn.Execute(&quot;SET NAMES &#39;gb2312&#39;&quot;)</p>
RangeTime:0.006821s
RangeMem:204.29 KB
返回顶部 留言