1:首先要下载mysql odbc
驱动2:安装驱动 并进行配置
3:代码
---------------------------------------
import com
conn = com.CreateObject("ADODB.Connection")
conn.ConnectionString = "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=91uni;Uid=root;Pwd=password;Connect Timeout=1000;"
conn.Open()
rs = com.CreateObject("ADODB.RecordSet")
rs.Open("select * from resume limit 0 , 10", conn )
io.open();
while(! rs.eof){
io.print( string.trimright( rs("id").value ),string.trimright( rs("title").value ) )
rs.movenext()
}
rs.close();
conn.close();