如何使用ADO连接MYSQL数据库?调用MYSQL的存储过程?请给出示例,谢谢!

解决方案 »

  1.   

    连接字符:
    strCon = "driver=mysql odbc 3.51 driver;" & _
             "server=数据库服务器IP地址;" & _
             "database=数据库名称;" & _
             "port=3306;" & _
             "uid=用户名;" & _
             "pwd=用户口令"
      

  2.   

    dim cn as adodb.connection
    dim rs as adodb.recordsetset cn = new adodb.connection
    set rs = new adodb.recordset
    cn.open strCon
    .....
    ...
    cn.close
    set rs = nothing
    set cn = nothing
      

  3.   

    安装mySql for odbc的驱动程序就可以找到了。
      

  4.   

    连数据库
    Public cnn As ADODB.Connection
    Public Function ConnectString() _
       As String
          ConnectString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=BatheSystem;Data Source=."
    End Function
    调存储过程
    cnn.Execute "存储过程名"