com.ExecuteNonQuery()出现语法错误
我也真是跪了源代码我写了一遍这里错了,从同学可以运行的代码上扒下来还是错的,求助到底哪错了!!!asp.net(VB+access)ProtectedSubButton1...
我也真是跪了源代码我写了一遍这里错了,从同学可以运行的代码上扒下来还是错的,求助到底哪错了!!!
asp.net(VB + access)
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s, t As String
Dim con As New OleDbConnection()
s = "provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= " & Server.MapPath("~\\App_data\\user.mdb")
con.ConnectionString = s
t = "Insert into [user](username,password,emailaddress) Values('" & TextBox1.Text & "', '" & TextBox2.Text & "','" & TextBox4.Text & "')"
Dim com As New OleDbCommand(t, con)
com.CommandText = t
con.Open()
com.ExecuteNonQuery()
con.Close()
End Sub 展开
asp.net(VB + access)
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s, t As String
Dim con As New OleDbConnection()
s = "provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= " & Server.MapPath("~\\App_data\\user.mdb")
con.ConnectionString = s
t = "Insert into [user](username,password,emailaddress) Values('" & TextBox1.Text & "', '" & TextBox2.Text & "','" & TextBox4.Text & "')"
Dim com As New OleDbCommand(t, con)
com.CommandText = t
con.Open()
com.ExecuteNonQuery()
con.Close()
End Sub 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏30(财富值+成长值)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询