嗨,我如何在我的系统中编写代码,即
1) 用户 1:添加、删除、更新、查看 2) 用户 2:仅更新 3) 用户 3:仅查看
我使用 vb.net 和访问数据库。有一些我的代码
Dim strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\user\Documents\MIS\LabSystem\LabTestSystem\LabSystemDB.mdb"
Dim conn As New OleDbConnection(strConnectionString)
conn.Open()
'Enter default login details username and password
cmd = New OleDbCommand("select * from Login where username='" & TextBox1.Text & "' and password='" & TextBox2.Text & "'", conn)
dt.Clear()
da = New OleDbDataAdapter(cmd)
da.Fill(dt)
If dt.Rows.Count > 0 Then
Session("username") = TextBox1.Text
Response.Redirect("Main.aspx")
Else
TextBox1.Text = ""
TextBox2.Text = ""
Label1.Text = "Incorrect value: Invalid login or password."
Label1.ForeColor = System.Drawing.Color.Red
End If