-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和密碼不是明智的信息...... –