473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

can anyone help me out for creating a searching table

Im doing a project on cyber cafe managment which needs search and it should search for name ,phone,date ....Theirs a constrain that if the names of the users are same then it has to give me all the users with the name :)
Oct 22 '13 #1
4 1077
this is the code which i used...to search for a single attribute but i want the fields which are repeated to be shown along wit it
Expand|Select|Wrap|Line Numbers
  1. Dim rs As New ADODB.Recordset
  2. Dim cn As New ADODB.Connection
  3.  
  4. Private Sub cmdsearch_Click()
  5. If txtsearch = "" Then
  6. MsgBox "invalid search keyword", vbCritical, "book"
  7. Exit Sub
  8. End If
  9. cn.Open
  10. rs.Open "select * from s5 where name='" & txtsearch & "' or phone='" & txtsearch & "' or d1='" & txtsearch & "'", cn, adOpenDynamic, adLockOptimistic
  11. If rs.EOF And rs.BOF Then
  12. MsgBox "item doesnot exist", vbCritical, "book"
  13. Else
  14. lblsearch.Caption = "Name:" + rs!Name + vbNewLine + "Phone Number:" + rs!phone + vbNewLine + "Date:" + rs!d1
  15. End If
  16. rs.Close
  17. cn.Close
  18. End Sub
  19.  
  20. Private Sub Form_Load()
  21. Set cn = New ADODB.Connection
  22. Set rs = New ADODB.Recordset
  23. cn.ConnectionString = "Provider=MSDAORA.1;Password=tiger;User ID=system;Persist Security Info=True"
  24. End Sub
Oct 22 '13 #2
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code or formatted data.

I don't know what you mean by "the fields that are repeated"
Oct 22 '13 #3
CyberSoftHari
487 Expert 256MB
Use sql query to do
Sample:
Expand|Select|Wrap|Line Numbers
  1.    strSql = "Select * from TableName Where searchField1 like '" & strSearchString & "%' or searchField2 like '" & strSearchString & "%'"
  2.  
Searching type differ for date, number and, text.
Oct 23 '13 #4
thanks a lot !! :) well is there any way to get a round shape command button in vb?
Oct 25 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Galina | last post by:
Hello I am trying to create a table, which includes a field type LONG. The wizard hasn't allowed me to enter storage settings for this table. It set the initial size is 64K and not available to...
2
by: David Heller | last post by:
I have this schema I exported from a database running mysql version 4.01 I'm trying to create this table on a server running mysql 3.23 I keep getting a syntax error near line 11 (I added the line...
4
by: gonzal | last post by:
Hi Dose any body know why a temporary table gets deleted after querying it the first time (using SELECT INTO)? When I run the code bellow I'm getting an error message when open the temp table...
2
by: Derek Griffiths | last post by:
Basically I'm just trying to get my program to make a simple table. Lucky for me that I choose to start with the simple ones I suppose. Here's the SQL command I am trying to run: "CREATE TABLE...
3
by: Priya | last post by:
Hi, I need to create a temp table in my asp.net web services program. I have an xml file of the format <uom_masters> <uom_code>varchar</uom_code> <uom_description>varchar</uom_description>...
5
by: fjleon | last post by:
Hi, i want to create a table declared inside a <td> , which already exists as follows: <tr> <td id="prueba" colspan="4"> </td> </tr> I have a button somewhere calling this script, which i...
5
by: KewlToyZ | last post by:
Good day, I am stuck in a strange situation. SQL 2000 Server, creating a stored procedure to use in Crystal Reports 11. I am trying to build a report without creating a table or temprorary table in...
6
by: Ledmark | last post by:
Hello - I am in a class for Access 2007 Database apllication design and we are covering types of Validation rules. We have a problem that I'm trying to solve but have no idea how to go about writing...
1
by: replica watch | last post by:
I am creating a table cell by cell (create the table, add columns, create row, add cells to the row) in which I want to add the capability for users to sort ASC and DESC by column header. Can...
4
by: monion | last post by:
I am having a heck of a time creating a table with more than 140 or so columns when using php into mysql. Any known issues after a certain #? Thanks,
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.