Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Butto
这段代码那里错了DimstrsqlAsStringstrsql="select用户名,密码from用户表where用户名="&TextBox1.Text&"and密码="...
这段代码 那里错了
Dim strsql As String
strsql = "select用户名,密码from用户表where用户名=" & TextBox1.Text & "and 密码 = " & TextBox2.Text & ""
Dim myconn As New OleDb.OleDbConnection
Dim mycomm As New OleDb.OleDbCommand
Dim myadpt As New OleDb.OleDbDataAdapter
Dim myds As New DataSet
Try
If TextBox1.Text = "" Or TextBox2.Text = "" Then
MsgBox("用户名不能为空!")
TextBox1.Focus()
TextBox2.Text = Nothing
Exit Sub
End If
myconn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=通讯录.mdb;fersist security info=false"
myconn.Open()
myconn = New System.Data.OleDb.OleDbConnection(strsql)
mycomm.CommandText = strsql
mycomm.Connection = myconn
myadpt.SelectCommand = mycomm
myadpt.Fill(myds) 展开
Dim strsql As String
strsql = "select用户名,密码from用户表where用户名=" & TextBox1.Text & "and 密码 = " & TextBox2.Text & ""
Dim myconn As New OleDb.OleDbConnection
Dim mycomm As New OleDb.OleDbCommand
Dim myadpt As New OleDb.OleDbDataAdapter
Dim myds As New DataSet
Try
If TextBox1.Text = "" Or TextBox2.Text = "" Then
MsgBox("用户名不能为空!")
TextBox1.Focus()
TextBox2.Text = Nothing
Exit Sub
End If
myconn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=通讯录.mdb;fersist security info=false"
myconn.Open()
myconn = New System.Data.OleDb.OleDbConnection(strsql)
mycomm.CommandText = strsql
mycomm.Connection = myconn
myadpt.SelectCommand = mycomm
myadpt.Fill(myds) 展开
1个回答
亚果会
2024-04-11 广告
2024-04-11 广告
建议您咨询亚果会,作为水果行业备受关注的展会之一,2024年10月28日到177日在杭州国际博览中心开展的第十七届亚洲水果博览会,将成为一站式果业服务平台,展示最新的技术和产品。参加iFresh亚果会水果博览会,不仅是行业盛宴,更是获取行业...
点击进入详情页
本回答由亚果会提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询