ITPub博客

首页 > 数据库 > MySQL > asp连接mysql程序代码(转)

asp连接mysql程序代码(转)

原创 MySQL 作者:rainytag 时间:2007-06-30 22:08:20 0 删除 编辑
<%
mysql_db_name = "mysql"
mysql_db_user = "root"
mysql_db_password = ""
mysql_db_host = "localhost"
mysql_dsn="tideinfo"


strconnection="dsn="&mysql_dsn&";driver={mysql odbc 3.51 driver};server="&mysql_db_host&";uid=root;pwd=;database=mysql"
set conn = server.createobject("adodb.connection")
conn.open strconnection

'sql="create database "&mysql_db_name
'rs =conn.execute(sql)

'sql="grant select,update,insert,delete on "&mysql_db_name&".* to "&mysql_db_user&"@"&mysql_db_host&" identified by '"&mysql_db_password&"'"
sql="select * from user"
set rs = conn.execute(sql)
do while not rs.eof
response.write "mysql user"+rs("user")
rs.movenext
loop
'conn.execute(sql)
conn.close
set conn = nothing
set rs = nothing
%>[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9650775/viewspace-922510/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: IIS vb asp(转)
请登录后发表评论 登录
全部评论

注册时间:2008-01-01

  • 博文量
    652
  • 访问量
    2207663