balckeagle 2005年03月22日
郁闷死了!!!.有没有高手帮我看看问题出在哪?
Private Sub cmdfind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdfind.Click
Dim blnisbn As Boolean, strisbn As String = txtisbn.Text
blnisbn = System.Text.RegularExpressions.Regex.IsMatch(strisbn, "^\d{1}-\d{3,5}-\d{3,5}-\d$")
If blnisbn = False Then
MsgBox("你输入的ISBN编号格式不正确.应为:x-xxxx-xxxx-x格式.x代表数字.中间部份可以是三位也可以是四位.五位数字")
txtISBN.Focus()
Else

Dim objcon As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Library.mdb")
objcon.Open()
Dim strselect As String = "select * from Borrow_ReturnBack where ISBN ='" + strisbn + "'"
Dim datacmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(strselect, objcon)
Dim count As OleDb.OleDbDataReader = datacmd.ExecuteReader()
If count.HasRows = True Then
flag = 2
MsgBox("找到符合条件的借书记录")
count.NextResult()
Try


txtborrowid.Text = count.GetInt32(0) '''这里怎么取某一列的值填到一个文本框上去???


Catch ex As Exception
MsgBox(ex.ToString)
End Try


Else
MsgBox("找不到符合条件的借书记录,请确认你输入的ISBN编号是否正确。")
End If
objcon.Close()
End If

End Sub
...全文
124 点赞 收藏 7
写回复
7 条回复

还没有回复,快来抢沙发~

发动态
发帖子

863

社区成员

5.5w+

社区内容

VB 数据库(包含打印,安装,报表)
社区公告
暂无公告