找VB达人,帮我啊,感激不尽 VB编一个查询功能的软件
谁帮我用VB编个查询的软件.在加些删除添加功能,。要用数据库的吧??VISTA系统下能运行VB不。我的只能用VB精简版,。可以吗?谁能帮我啊下!联系我啊。。我的系统是VI...
谁帮我用VB 编个查询的软件.在加些删除添加功能,。要用数据库的吧??
VISTA 系统下能运行VB不。 我的只能用VB精简版,。可以吗?
谁能帮我啊下!联系我啊。。
我的系统是VISTA 要做个有数据库的啊不然有代码运行不了数据库的代码...希望达人帮我.
204651851QQ的我加
啊急紧我加们你等线在
尽不激感 展开
VISTA 系统下能运行VB不。 我的只能用VB精简版,。可以吗?
谁能帮我啊下!联系我啊。。
我的系统是VISTA 要做个有数据库的啊不然有代码运行不了数据库的代码...希望达人帮我.
204651851QQ的我加
啊急紧我加们你等线在
尽不激感 展开
4个回答
展开全部
查询:
在form加上1个Textbox,1个commmandbutton和1个Listbox
Textbox=txtfind
CommandButton=cmdsearch
ListBox=List1
以下为取消查询按钮代码,可查询日期,文字和数字.
Private Sub cmdsearch_Click()
Select Case rs.Fields(List1.ListIndex).Name
Case "Items"
SQL = "select * from Table Name where Items=" & "'" & txtfind.Text & "'"
Case "Price"
SQL = "select * from Table Name where Price=" & txtfind.Text
Case "Date"
SQL = "select * from Table Name where Date = #" & txtfind.Text & "#"
End Select
If rs.State = adStateOpen Then rs.Close
rs.Open SQL, cn, adOpenStatic, adLockOptimistic
End Sub
----------------------------------
例如在Form中设置3个Textbox和5个CommandButton
分别为
Textbox=Date(txtdate),Items(txtitems),Price(txtprice).
CommandButton = 新增(cmdadd),储存(cmdsave),删除(cmddelete),
取消新增(cmdcancel),编辑(cmdedit).
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim mode as string
Private Sub Form_Load()
cn.ConnectionString = "provider=Microsoft.jet.OLEDB.4.0;" & _
"Persist security info= False; Data source=" & App.Path & "\daily.mdb"
cn.Open
rs.CursorLocation = adUseClient
rs.Open "Daily", cn, adOpenKeyset, adLockPessimistic (Daily为Access 资料表名)
For i = 0 To rs.Fields.Count - 1
List1.AddItem rs.Fields(i).Name
Next i
End Sub
以下自作函数以便文本栏显示资料表资料
Sub LoadControls()
If rs.BOF = False And rs.EOF = False Then
txtdate = rs.Fields("Date")
txtitems = rs.Fields("Items")
txtprice = rs.Fields("Price")
End If
End Sub
以下为新增按钮代码
Private Sub cmdadd_Click()
mode = "add"
txtdate.Text = CStr(Date) (显示系统今天日期)
txtitems.SetFocus
txtitems = ""
txtprice = ""
End Sub
以下为编辑按钮代码
Private Sub cmdedit_Click()
mode = "edit"
Call LoadControls
txtdate.SetFocus
End Sub
以下为删除按钮代码
Private Sub cmddelete_Click()
If rs.EOF = False Then
X = MsgBox("Do you want to delete this record", vbExclamation + vbYesNo)
If X = vbYes Then
rs.Delete
rs.Requery
Call LoadControls
Else
Exit Sub
End If
End If
End Sub
以下为储存按钮代码
Private Sub cmdsave_Click()
If mode = "add" Then
rs.AddNew
rs.Fields("Date") = txtdate
rs.Fields("Items") = txtitems
rs.Fields("Price") = txtprice
rs.Update
MsgBox "Successfully Save Data", vbInformation + vbOKOnly
rs.Requery
txtdate.SetFocus
Call LoadControls
Exit Sub
End If
End Sub
If mode = "edit" Then
rs.Fields("Date") = txtdate
rs.Fields("Items") = txtitems
rs.Fields("Price") = txtprice
rs.Update
MsgBox "Successfully Save Data", vbInformation + vbOKOnly
rs.Requery
txtdate.SetFocus
Call LoadControls
Exit Sub
End If
以下为取消新增按钮代码
Private Sub Cmdcancel_Click()
Call LoadControls
End Sub
以下为推介教学:
源代码下载
http://www.newasp.net/code/vb/1007.html
http://www.codesky.net/search.asp?search=%BE%C6%B5%EA&selbig=VB%D4%B4%C2%EB&r=1
http://www.winu.cn/forumdisplay.php?fid=120&page=1
http://www.programfan.com/code/codelist.asp?softclass=104&page=4
推介网址,
http://www.ibook8.com/book/vb1.htm
大量VB电子书网站
http://download.chinaitlab.com/special/vbebook.htm
http://www.mydown.com/tests/ziliaoxiazai/dianzijiaocheng/vb/his.shtml
推介VB视频
http://lib.verycd.com/2005/04/28/0000048567.html
http://www.ibook8.com/software/catalog54/2022.html
http://www.enet.com.cn/eschool/video/vb2/
http://www.enet.com.cn/eschool/video/vb/
http://tech.163.com/special/000915SN/vbgreat.html
http://x8.maicoo.com/tech/vb/17264.html
http://www.bianceng.cn/VBjc/vbjc/index.HTM
其他
http://www.winu.cn/forumdisplay.php?fid=44
http://www.vbgood.com/vb.good/code-categoryid-4.html
博客
http://www.tiancao.net/blogview.asp?logID=576
在form加上1个Textbox,1个commmandbutton和1个Listbox
Textbox=txtfind
CommandButton=cmdsearch
ListBox=List1
以下为取消查询按钮代码,可查询日期,文字和数字.
Private Sub cmdsearch_Click()
Select Case rs.Fields(List1.ListIndex).Name
Case "Items"
SQL = "select * from Table Name where Items=" & "'" & txtfind.Text & "'"
Case "Price"
SQL = "select * from Table Name where Price=" & txtfind.Text
Case "Date"
SQL = "select * from Table Name where Date = #" & txtfind.Text & "#"
End Select
If rs.State = adStateOpen Then rs.Close
rs.Open SQL, cn, adOpenStatic, adLockOptimistic
End Sub
----------------------------------
例如在Form中设置3个Textbox和5个CommandButton
分别为
Textbox=Date(txtdate),Items(txtitems),Price(txtprice).
CommandButton = 新增(cmdadd),储存(cmdsave),删除(cmddelete),
取消新增(cmdcancel),编辑(cmdedit).
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim mode as string
Private Sub Form_Load()
cn.ConnectionString = "provider=Microsoft.jet.OLEDB.4.0;" & _
"Persist security info= False; Data source=" & App.Path & "\daily.mdb"
cn.Open
rs.CursorLocation = adUseClient
rs.Open "Daily", cn, adOpenKeyset, adLockPessimistic (Daily为Access 资料表名)
For i = 0 To rs.Fields.Count - 1
List1.AddItem rs.Fields(i).Name
Next i
End Sub
以下自作函数以便文本栏显示资料表资料
Sub LoadControls()
If rs.BOF = False And rs.EOF = False Then
txtdate = rs.Fields("Date")
txtitems = rs.Fields("Items")
txtprice = rs.Fields("Price")
End If
End Sub
以下为新增按钮代码
Private Sub cmdadd_Click()
mode = "add"
txtdate.Text = CStr(Date) (显示系统今天日期)
txtitems.SetFocus
txtitems = ""
txtprice = ""
End Sub
以下为编辑按钮代码
Private Sub cmdedit_Click()
mode = "edit"
Call LoadControls
txtdate.SetFocus
End Sub
以下为删除按钮代码
Private Sub cmddelete_Click()
If rs.EOF = False Then
X = MsgBox("Do you want to delete this record", vbExclamation + vbYesNo)
If X = vbYes Then
rs.Delete
rs.Requery
Call LoadControls
Else
Exit Sub
End If
End If
End Sub
以下为储存按钮代码
Private Sub cmdsave_Click()
If mode = "add" Then
rs.AddNew
rs.Fields("Date") = txtdate
rs.Fields("Items") = txtitems
rs.Fields("Price") = txtprice
rs.Update
MsgBox "Successfully Save Data", vbInformation + vbOKOnly
rs.Requery
txtdate.SetFocus
Call LoadControls
Exit Sub
End If
End Sub
If mode = "edit" Then
rs.Fields("Date") = txtdate
rs.Fields("Items") = txtitems
rs.Fields("Price") = txtprice
rs.Update
MsgBox "Successfully Save Data", vbInformation + vbOKOnly
rs.Requery
txtdate.SetFocus
Call LoadControls
Exit Sub
End If
以下为取消新增按钮代码
Private Sub Cmdcancel_Click()
Call LoadControls
End Sub
以下为推介教学:
源代码下载
http://www.newasp.net/code/vb/1007.html
http://www.codesky.net/search.asp?search=%BE%C6%B5%EA&selbig=VB%D4%B4%C2%EB&r=1
http://www.winu.cn/forumdisplay.php?fid=120&page=1
http://www.programfan.com/code/codelist.asp?softclass=104&page=4
推介网址,
http://www.ibook8.com/book/vb1.htm
大量VB电子书网站
http://download.chinaitlab.com/special/vbebook.htm
http://www.mydown.com/tests/ziliaoxiazai/dianzijiaocheng/vb/his.shtml
推介VB视频
http://lib.verycd.com/2005/04/28/0000048567.html
http://www.ibook8.com/software/catalog54/2022.html
http://www.enet.com.cn/eschool/video/vb2/
http://www.enet.com.cn/eschool/video/vb/
http://tech.163.com/special/000915SN/vbgreat.html
http://x8.maicoo.com/tech/vb/17264.html
http://www.bianceng.cn/VBjc/vbjc/index.HTM
其他
http://www.winu.cn/forumdisplay.php?fid=44
http://www.vbgood.com/vb.good/code-categoryid-4.html
博客
http://www.tiancao.net/blogview.asp?logID=576
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
查询东西的sql:
select * from [表格] Where [列的名字] Like '%[关键词]%'
select * from [表格] Where [列的名字] Like '%[关键词]%'
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
好啊,你把数据库给我吧,还有具体要求。
应该能的。
应该能的。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
VB 啊? OK
我C语言很精的
你可以不用把数据给我
我试下自己编
先联系后给分,信誉第1
我C语言很精的
你可以不用把数据给我
我试下自己编
先联系后给分,信誉第1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询