当前位置: 代码迷 >> vbScript >> vbscript联接操作mysql
  详细解决方案

vbscript联接操作mysql

热度:1107   发布时间:2013-02-28 11:33:09.0
vbscript连接操作mysql

vbscript连接操作mysql

给出一段非常简单的vbscript操作mysql的脚本代码,连接其它数据库类似:

strConn="driver={mysql odbc 5.1 driver};server=192.168.1.111;database=xifeijian;port=3306;uid=root;password=root"

Set conn = CreateObject("adodb.connection")
conn.Open strConn
strSql="SELECT * FROM keyword  LIMIT 10;"
Set rs = CreateObject("adodb.recordset")
rs.Open strSql, conn, 1, 3
rs.MoveFirst

Do Until rs.EOF
     msgbox rs.Fields("name")
     rs.MoveNext
Loop

rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing

'增、删、改
'conn.execute strSql,intRowsAffect

  相关解决方案