VB6 远程连接mysql ,错误
有个网站服务器,数据库是mysql,我想用VB6做个连接,直接插入数据。
但远程连接的时候,出现错误提示。(Access denied for user)
以前谁成功连接mysql的,请指点一下撒。
我的连接语句是:
Private Sub Form_Load() Dim rss As ADODB.Recordset Dim cn As ADODB.Connection Set cn = New ADODB.Connection strCn = "driver=mysql odbc 3.51 driver; server= **.***.56.49; database=house; uid=fangyuan; pwd=fangyuan" cn.Open strCn strQuery = "SELECT * FROM house" Set rss = cn.Execute(strQuery) Set Me.Grid1.DataSource = rss For i = 0 To rss.Fields.Count - 1 Me.Grid1.Columns(i).CaptionAlignment = ssColCapAlignCenter Next 'Me.Grid1.Width = Screen.Width - 230 Me.Grid1.Columns(0).Width = 800 Me.Grid1.Columns(1).Width = 2500' Me.Grid1.Columns(2).Width = 2000 For i = 2 To rss.Fields.Count - 1 Me.Grid1.Columns(i).Visible = False NextEnd Sub