📄 search.bas
字号:
Attribute VB_Name = "search"
'书籍信息查询表=======================================================================
'查询书籍信息
Sub search_books(s_key As String, s_type As String)
Select Case s_type
Case "书名"
GoTo s_name
Case "作者"
GoTo s_author
Case "类型"
GoTo s_type
Case "出版社"
GoTo s_pub
End Select
Exit Sub
s_name:
books_search_form.books_info_source.RecordSource = "select books_id as 书籍ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_have as 在库否, b_address 存放位置,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_text as 备注信息,b_oper as 操作员 from books where b_name like '" & s_key & "'"
Exit Sub
s_author:
books_search_form.books_info_source.RecordSource = "select books_id as 书籍ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_have as 在库否, b_address 存放位置,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_text as 备注信息,b_oper as 操作员 from books where b_author like '" & s_key & "'"
Exit Sub
s_type:
books_search_form.books_info_source.RecordSource = "select books_id as 书籍ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_have as 在库否, b_address 存放位置,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_text as 备注信息,b_oper as 操作员 from books where b_type like '" & s_key & "'"
Exit Sub
s_pub:
books_search_form.books_info_source.RecordSource = "select books_id as 书籍ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_have as 在库否, b_address 存放位置,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_text as 备注信息,b_oper as 操作员 from books where b_pub like '" & s_key & "'"
Exit Sub
End Sub
'模糊查询书籍信息
Sub search_books_blur(s_key As String, s_type As String)
Select Case s_type
Case "书名"
GoTo s_name
Case "作者"
GoTo s_author
Case "类型"
GoTo s_type
Case "出版社"
GoTo s_pub
End Select
Exit Sub
s_name:
books_search_form.books_info_source.RecordSource = "select books_id as 书籍ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_have as 在库否, b_address 存放位置,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_text as 备注信息,b_oper as 操作员 from books where b_name like '%" & s_key & "%'"
Exit Sub
s_author:
books_search_form.books_info_source.RecordSource = "select books_id as 书籍ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_have as 在库否, b_address 存放位置,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_text as 备注信息,b_oper as 操作员 from books where b_author like '%" & s_key & "%'"
Exit Sub
s_type:
books_search_form.books_info_source.RecordSource = "select books_id as 书籍ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_have as 在库否, b_address 存放位置,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_text as 备注信息,b_oper as 操作员 from books where b_type like '%" & s_key & "%'"
Exit Sub
s_pub:
books_search_form.books_info_source.RecordSource = "select books_id as 书籍ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_have as 在库否, b_address 存放位置,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_text as 备注信息,b_oper as 操作员 from books where b_pub like '%" & s_key & "%'"
Exit Sub
End Sub
'书籍清除数据
Sub search_clear_books()
books_search_form.clear.RecordSource = "select books_id as 书籍ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_have as 在库否, b_address 存放位置,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_text as 备注信息,b_oper as 操作员 from books where b_isbn like 'XGY'"
Set books_search_form.books_info_view.DataSource = books_search_form.clear
End Sub
'=============================================================================================================
'用户信息查询表=======================================================================
'查询用户信息
Sub search_users(u_key As String, u_type As String)
Select Case u_type
Case "ID"
GoTo u_id
Case "姓名"
GoTo u_name
Case "部门"
GoTo u_type
Case "注册日期"
GoTo u_reg
End Select
Exit Sub
u_id:
users_search_form.users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注 from users where users_id like '" & u_key & "'"
Exit Sub
u_name:
users_search_form.users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注 from users where u_name like '" & u_key & "'"
Exit Sub
u_type:
users_search_form.users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注 from users where u_dep like '" & u_key & "'"
Exit Sub
u_reg:
users_search_form.users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注 from users where u_reg_date like '" & u_key & "'"
Exit Sub
End Sub
'模糊查询用户信息
Sub search_users_blur(u_key As String, u_type As String)
Select Case u_type
Case "ID"
GoTo u_id
Case "姓名"
GoTo u_name
Case "部门"
GoTo u_type
Case "注册日期"
GoTo u_reg
End Select
Exit Sub
u_id:
users_search_form.users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注 from users where users_id like '%" & u_key & "%'"
Exit Sub
u_name:
users_search_form.users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注 from users where u_name like '%" & u_key & "%'"
Exit Sub
u_type:
users_search_form.users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注 from users where u_dep like '%" & u_key & "%'"
Exit Sub
u_reg:
users_search_form.users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注 from users where u_reg_date like '%" & u_key & "%'"
Exit Sub
End Sub
'用户清除数据
Sub search_clear_users()
users_search_form.clear.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注 from users where u_reg_date like 'XGY'"
Set users_search_form.users_info_view.DataSource = users_search_form.clear
End Sub
'===============================================================================================================
'还书信息表====================================================================================================
'所有信息查询
Sub all()
return_info_form.return_info_source.RecordSource = "select users_id as 用户ID,books_id as 书籍ID ,re_u_name as 用户姓名,re_b_name as 书名,re_isbn as ISBN,re_price as 书籍价格,re_r_date as 归还日期 ,re_br_date as 借出日期 from return_b"
End Sub
'归还书籍查询
Sub ob()
return_info_form.return_info_source.RecordSource = "select users_id as 用户ID,books_id as 书籍ID ,re_u_name as 用户姓名,re_b_name as 书名,re_isbn as ISBN,re_price as 书籍价格,re_r_date as 归还日期 ,re_br_date as 借出日期 from return_b where (re_r_date-re_br_date)>30"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -