Microsoft Visual Studio 2005(vb)中连接access数,我需要具体的代码
DimconnAsNewOleDbConnectionDimcmdAsNewOleDbCommandconn.ConnectionString="provider=Mic...
Dim conn As New OleDbConnection
Dim cmd As New OleDbCommand
conn.ConnectionString = "provider=Microsoft.Jet.Oledb.4.0;data source=" & Server.MapPath("教材购销系统.mdb")
cmd.Connection = conn
cmd.CommandText = "update 用户表 set 密码='" & Tex2.Text & "' where 用户名='" & Tex1.Text & "'"
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
Response.Redirect("用户管理.aspx")
我写写段总是会提醒我server未声明,知道怎么回事吗? 展开
Dim cmd As New OleDbCommand
conn.ConnectionString = "provider=Microsoft.Jet.Oledb.4.0;data source=" & Server.MapPath("教材购销系统.mdb")
cmd.Connection = conn
cmd.CommandText = "update 用户表 set 密码='" & Tex2.Text & "' where 用户名='" & Tex1.Text & "'"
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
Response.Redirect("用户管理.aspx")
我写写段总是会提醒我server未声明,知道怎么回事吗? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询