ASP程序如何直接连接MYSQL数据库
发布时间:2023-12-25 05:28:23 所属栏目:Asp教程 来源:DaWei
导读: 在网上查找大量资料,经过自己的不懈努力,终于测试成功了。原来要在服务器上安装mysql odbc 3.51 ,还有数据库用户名及密码,用下面的密码就可以了。
以下为引用的内容:
<%
strconne
以下为引用的内容:
<%
strconne
在网上查找大量资料,经过自己的不懈努力,终于测试成功了。原来要在服务器上安装mysql odbc 3.51 ,还有数据库用户名及密码,用下面的密码就可以了。 以下为引用的内容: <% strconnection="driver={mysql odbc 3.51 driver};database=weste_net;server=localhost;uid=root;password=" set conn = server.createobject("adodb.connection") conn.open strconnection strquery = "select * from News" set rs = conn.execute(strquery) if not rs.bof then %> <table> <tr> <td<b>序列号</b></td> <td><b>标题</b></td> </tr> <% do while not rs.eof %> <tr> <td><%=rs("id")%></td> <td><%=rs("NTitle")%></td> </tr> <% rs.movenext loop %> </table> <% else response.write("无暂时没有.") end if rs.close conn.close set conn = nothing set rsdata = nothing %> (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐