Private Sub ADDMORE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ADDMORE.Click
Dim SQL As String
Dim SQL1 As String
SQL1 = "select * from [基本信息表] where [学号]='" & IDTextBox1.Text & " '"
rs.Open(SQL1, conn)
SQL = "insert into [基本信息表] ([学号],[姓名],[性别],[班级],[籍贯],[手机],[宿舍]) values ('" & IDTextBox1.Text & "','" & NAMETextBox1.Text & "','" & SEXTextBox4.Text & "','" & CLASSTextBox8.Text & "','" & PLACETextBox6.Text & "','" & PHONETextBox5.Text & "','" & ROOMTextBox9.Text & "');"
rs.Open(SQL, conn, 1, 1)
If (IDTextBox1.Text <> " " And rs.EOF = True) Then conn.Execute(SQL)
rs.Close()
conn.Close()
Else
MsgBox("学号不能为空或重复!!!", vbInformation, "错误提示")
End If
conn.Close()
End Sub错误信息如下:
在 System.Runtime.InteropServices.COMException 中第一次偶然出现的“2010Image engineeringSys.exe”类型的异常
“System.Runtime.InteropServices.COMException”类型的未经处理的异常出现在 2010Image engineeringSys.exe 中。其他信息: 对象打开时,不允许操作。谢谢!!
Dim SQL As String
Dim SQL1 As String
SQL1 = "select * from [基本信息表] where [学号]='" & IDTextBox1.Text & " '"
rs.Open(SQL1, conn)
SQL = "insert into [基本信息表] ([学号],[姓名],[性别],[班级],[籍贯],[手机],[宿舍]) values ('" & IDTextBox1.Text & "','" & NAMETextBox1.Text & "','" & SEXTextBox4.Text & "','" & CLASSTextBox8.Text & "','" & PLACETextBox6.Text & "','" & PHONETextBox5.Text & "','" & ROOMTextBox9.Text & "');"
rs.Open(SQL, conn, 1, 1)
If (IDTextBox1.Text <> " " And rs.EOF = True) Then conn.Execute(SQL)
rs.Close()
conn.Close()
Else
MsgBox("学号不能为空或重复!!!", vbInformation, "错误提示")
End If
conn.Close()
End Sub错误信息如下:
在 System.Runtime.InteropServices.COMException 中第一次偶然出现的“2010Image engineeringSys.exe”类型的异常
“System.Runtime.InteropServices.COMException”类型的未经处理的异常出现在 2010Image engineeringSys.exe 中。其他信息: 对象打开时,不允许操作。谢谢!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货