|
2#
楼主 |
发表于 2008-6-29 18:30:09
|
只看该作者
这里再补充两个网友的ADO代码,供大家参考:- Set Conn = CreateObject("ADODB.Connection" )
- str="DRIVER={MySQL ODBC 3.51 Driver};SERVER=192.168.1.107;DATABASE=wp_core;user id=root; password=45retret4"
- Conn.open str
- Set Rs = CreateObject ("ADODB.Recordset" )
- select_role_id="select * from `wp_core`.`wp_role` limit 0, 5000"
- rs.open select_role_id,conn,1,3
- if (not Rs.eof) then
- role_id=rs(0)
- msgbox(role_id)
- rs.fields("id")=8888
- rs.update
- end if
- rs.addnew
- rs.fields("id")="8888"
- rs.fields("name")="zhouruijun"
- msgbox(rs(0))
- msgbox(rs(1))
- rs.update()
- Rs.close
- Set Rs = Nothing
- Conn.close
- Set Conn = Nothing
复制代码- Set Conn = CreateObject("ADODB.Connection" )
- str="DRIVER={MySQL ODBC 3.51 Driver};SERVER=192.168.1.100;DATABASE=wp_blog;user id=zzz ; password=123456"
- Conn.open str
- Set Rs = CreateObject ("ADODB.Recordset" )
- sql = "select * from `wp_blog`.`blg_webcategory` limit 0, 5000;"
- Rs.open sql,conn,1,3
- If (not Rs.eof) then
- Rs.MoveFirst
- MsgBox Rs(0)
- MsgBox Rs(1)
- MsgBox Rs(2)
- MsgBox Rs(3)
- end if
- Rs.close
- Set Rs = Nothing
- Conn.close
- Set Conn = Nothing
复制代码 |
|