wps+vba+sql做报表系统,主机上运行没问题,客户端运行出错 用的是SQL 2005,WPS做报表系统,SQL通信已设置好,用数据源(ODBC)工具测试过主机与客户端都可以访问SQL。
下面一段程序在主机上没出错,可到了客户端运行就报错,报错地方已注明。
Public operater As String
Private Sub CommandButton1_Click()
Dim login As Boolean, denji As Boolean
Application.Visible = True
If TextBox1.Text = "无" And TextBox2.Text = "无" Then
login = True
denji = True
GoTo line1
End If
If TextBox1.Text <> "" And TextBox2.Text <> "" Then
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strCn As String, strSQL As String
strCn = "Provider=sqlncli.1;Server=192.168.1.102,1433;Database=123;Uid=kk;Pwd=123456;
strSQL = "select * from operater where name=N'" & TextBox1.Text & "'"
cn.Open strCn (运行时错误指向这里,错误代码是3706,未找到提供程序) ------解决方案--------------------