-1
有编译出错用户定义类型没有定义VBA
'user-defined type not defined'
我在VB6得到当我试图编译这段代码。有人可以告诉我我需要做什么来解决这个错误吗?以下是我得到的错误行: 这里是我的代码:
Private Sub CommandButton1_Click()
Set cnnConnection = New ADODB.connection
cnnConnection.Open ("Provider=SQLOLEDB; " & _"data Source=180.125.20.96;" & _"Initial Catalog=path_test; " & _"User Id=sa;Password=Psword4886")
rstRecordset.Open "Select * from REM_M_Pojhd where PRJCDE [email protected]", cnnConnection, _adOpenKeyset, adLockOptimistic
Dim command As New SqlCommand("Select * from REM_M_Prjhdrimg where PRJCD [email protected]", connection)
command.Parameters.Add("@PRJCD", SqlDbType.VarChar).Value = TextBox1.Text
Dim table As New DataTable()
Dim adapter As New SqlDataAdapter(command)
adapter.Fill (table)
If table.Rows.Count() <= 0 Then
MessageBox.Show ("No Image For This Id")
Else
TextBox1.Text = table.Rows(0)(0).ToString()
TextBox2.Text = table.Rows(0)(1).ToString()
TextBox3.Text = table.Rows(0)(2).ToString()
Dim img() As Byte
img = table.Rows(0)(3)
Dim ms As New MemoryStream(img)
Image1.Image = Image.FromStream(ms)
End If
End Sub
我没有太大的程序员知识渊博,我还只是一个学生,在做一点点的详细陈述解释。 谢谢!
哪条线给你错误? –
所以VBA和VB6有很大的区别!请确定你正在使用哪一个你的问题和标签。 –
我的确希望连接字符串中的数据源,ID和密码不是明智的信息...... –