Dim Cnn,res,sql
Set Cnn = CreateObject("ADODB.Connection")
Set res=createobject("adodb.recordset")
Cnn.ConnectionString ="DRIVER={MySQL ODBC 5.1 Driver};SERVER=192.168.1.218;DATABASE=findlaw_fagui;PORT=3307;USER=gTqcweber3wqYne3;PWD=3Tbdswer8Gwe23"
Cnn.Open
Cnn. Set res=cmd.Execute() msgbox res(0) msgbox Cnn.State
sql="SELECT id FROM newfg_fagui"
If Cnn.State = 0 Then
msgbox "连接数据库失败"
else
msgbox "连接数据库成功"
end if
218

被折叠的 条评论
为什么被折叠?



