主题:登陆后,出现不了窗口,帮忙看一下。谢谢
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Conn = New OleDb.OleDbConnection(Provider & ";" & Database)
Conn.Open()
SQL = "Select * From login Where Name='" & UsernameTextBox.Text & "' And Password='" & PasswordTextBox.Text & "'"
Cmd = New OleDb.OleDbCommand(SQL, Conn)
Rd = Cmd.ExecuteReader()
If Rd.Read Then
Dim form1 As New Form1
form1.Show()
Me.Hide()
Else
MessageBox.Show("密码错了", "错误提未", MessageBoxButtons.OK, MessageBoxIcon.Error)
UsernameTextBox.Text = ""
PasswordTextBox.Text = ""
UsernameTextBox.Focus()
End If
Rd.Close()
Conn.Close()
Me.Close()
End Sub
通过检证后。
出现不了Form1
我想应该是
Dim form1 As New Form1
form1.Show()
这句的错误吧?
VB2005+ACCESS写的
麻烦了
Conn = New OleDb.OleDbConnection(Provider & ";" & Database)
Conn.Open()
SQL = "Select * From login Where Name='" & UsernameTextBox.Text & "' And Password='" & PasswordTextBox.Text & "'"
Cmd = New OleDb.OleDbCommand(SQL, Conn)
Rd = Cmd.ExecuteReader()
If Rd.Read Then
Dim form1 As New Form1
form1.Show()
Me.Hide()
Else
MessageBox.Show("密码错了", "错误提未", MessageBoxButtons.OK, MessageBoxIcon.Error)
UsernameTextBox.Text = ""
PasswordTextBox.Text = ""
UsernameTextBox.Focus()
End If
Rd.Close()
Conn.Close()
Me.Close()
End Sub
通过检证后。
出现不了Form1
我想应该是
Dim form1 As New Form1
form1.Show()
这句的错误吧?
VB2005+ACCESS写的
麻烦了