vb.net操作access数据库时,出现了问题,在线等啊······
代码如下:PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Hand...
代码如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New OleDbConnection
Dim cmd As New OleDbCommand
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\users\administrator\desktop\信息管理系统\土木管理\土木管理\信息管理系统.accdb"
con.Open()
cmd.Connection = con
cmd.CommandText = "select keyss from 用户信息表 where ID=1"
Dim dr As OleDbDataReader = cmd.ExecuteReader()
' If dr.GetString(1) Then
' xingming = dr(0)
' End If
dr.Close()
con.Close()
End Sub 展开
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New OleDbConnection
Dim cmd As New OleDbCommand
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\users\administrator\desktop\信息管理系统\土木管理\土木管理\信息管理系统.accdb"
con.Open()
cmd.Connection = con
cmd.CommandText = "select keyss from 用户信息表 where ID=1"
Dim dr As OleDbDataReader = cmd.ExecuteReader()
' If dr.GetString(1) Then
' xingming = dr(0)
' End If
dr.Close()
con.Close()
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询