Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Label2.Visible = True
If TextBox30.Text = "" Or TextBox31.Text = "" Then
Label2.Text = "填写用户名和密码"
Else
Dim conn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("../intreg/mydata.mdb"))
Dim cmd As New OleDbCommand("select * from users where username='" & TextBox30.Text & "'And pwd='" & TextBox31.Text & "'", conn)
conn.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader()
If dr.Read() = True Then
conn.Close()
Panel1.Visible = True
Panel2.Visible = False
Else
conn.Close()
Label2.Text = "您必须输入有效的用户名和密码!"
End If
End If
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Label3.Visible = True
If TextBox32.Text = "" Or TextBox33.Text = "" Or TextBox34.Text = "" Then
Label3.Text = "请填写用户名和密码"
ElseIf TextBox32.Text <> TextBox34.Text Then
Label3.Text = "两次密码不同"
Else
Dim conn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("../intreg/mydata.mdb"))
Dim cmd As New OleDbCommand("select * from users where username='" & TextBox33.Text & "'", conn)
conn.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader
If dr.Read() Then
Label3.Text = "您选择的用户名已经存在,请重新选择!"
conn.Close()
Else
conn.Close()
Dim conn1 As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("../intreg/mydata.mdb"))
Dim str As String
str = "insert into users(username,pwd) values('" & TextBox33.Text & "','" & TextBox32.Text & "')"
Dim cmd1 As New OleDbCommand(str, conn1)
conn1.Open()
cmd1.ExecuteNonQuery()
conn1.Close()
Panel2.Visible = True
Panel3.Visible = False
End If
End If
End Sub
为什么我在本地调试的时候没问题,可是一上传到FTP后,写不进数据库了???