473,785 Members | 2,794 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Searching the database

62 New Member
I am developing a program using Visual Basic 6, it handles car inventory and the issue and expiring date of the vehicles. The aim is to be able to search for the vehicle licences that are expiring at a certain period to renew them. Now am at the peak of it where I have to perform thsi but I have no clue.I need it to search the database for a range of dates. How do I go about this?
Note: The database contains different fields with different expiring date, so am not just searching one field. Can I use MSflexiGrid to display the result?
Thank you
Nov 6 '06 #1
4 1579
willakawill
1,646 Top Contributor
I am developing a program using Visual Basic 6, it handles car inventory and the issue and expiring date of the vehicles. The aim is to be able to search for the vehicle licences that are expiring at a certain period to renew them. Now am at the peak of it where I have to perform thsi but I have no clue.I need it to search the database for a range of dates. How do I go about this?
Note: The database contains different fields with different expiring date, so am not just searching one field. Can I use MSflexiGrid to display the result?
Thank you
Hi. A little more information about the structure of the database (is it MS Access? What are the fields?) and a code snippet of where you are up to will help a lot in getting you where you want to be.
Thanks
Nov 6 '06 #2
nkechifesie
62 New Member
Hi. A little more information about the structure of the database (is it MS Access? What are the fields?) and a code snippet of where you are up to will help a lot in getting you where you want to be.
Thanks
The database is MS Access and the fields that am trying to search for are date data types.
I dont know if given you the code would help because I havent written anything on the search but have written on the other areas. You could give me your email address so i could send the whole program to you and indicate the area am having difficulty in.
Nov 6 '06 #3
LacrosseB0ss
113 New Member
how is your SQL knowledge? The best solution is 2 steps:

(1) Figure out the minimum date you want to search for. Then find the max date you want to find. The min will be sometime close to when the plate will expire (or today which is Now()) and max will be expiration date. These values will go in your SQL "Where" statement.

(2) Create and open a record set using your SQL statement to find only the relevant licenses. Use this to show all the data that appears.

Example of SQL:
Select licencePlate
from car (table)
where expiration > mindate
and expiration < maxdate

**of course you will sub in your own field names.
Nov 6 '06 #4
nkechifesie
62 New Member
how is your SQL knowledge? The best solution is 2 steps:

(1) Figure out the minimum date you want to search for. Then find the max date you want to find. The min will be sometime close to when the plate will expire (or today which is Now()) and max will be expiration date. These values will go in your SQL "Where" statement.

(2) Create and open a record set using your SQL statement to find only the relevant licenses. Use this to show all the data that appears.

Example of SQL:
Select licencePlate
from car (table)
where expiration > mindate
and expiration < maxdate

**of course you will sub in your own field names.

Thanks, I do understand Sql to a limit and would have been able to do what you
said if it was just one field that am running the search on. I have like 13 columns i need to run the search on for each car as it has various licences like Vehicle Licence, Heavy Duty Permit and all that. So what do I do?Am going to try using a join after I create separate recordset for each column, would that work?
Nov 7 '06 #5

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

Similar topics

2
2533
by: John | last post by:
Hi everyone ! This is a first time I post a message here. If I post my message in a wrong group. Please ignore it. I am trying to build a website which allows users (can be thousands of users, supposedly) to upload their files to their designaged directories (max 15 files for each user). A super user (can be more than one) want to search for a particular file name and also a particular textual part of a file of all user's files in all...
4
1640
by: donald | last post by:
Hi all, I have a website running asp (about to move to asp.net soon though) which has a list of DVD's I have the various pages I want, last 10, listing, full listing ect, but the one page i can't figure out is a search page. I have read various books, but none have given any tips on how to make a search page for a access DB. Could someone point me to a tutorial? Thanks
4
2765
by: Michi | last post by:
I was wondering what the best solution is for making large numbers of TEXT (or BLOB?) fields searchable. For example, if I have a forum, what is the best way to be able to search for specific words? How about exact phrases? I saw a solution where all words are preindexed in a "dictionary" like table and then another table stores the word matches. That seems really fast, but it has two major problems: 1) it can't do exact matches, and 2)...
0
1571
by: Chris Chandler | last post by:
Hello I am developing a web application that uses full text searching quite extensively. This is ideal where I am searching a large number of large varchar fields for a set of key words. My problem is that each user on the site has a number of keywords in the database (approx 200000 users) and when I add a new item with the large varchar field I need to match all users who's keywords are found within the varchar text.
10
5490
by: sffan | last post by:
I am new to database programming and was curious how others solve the problem of storing encrypted in data in db table columns and then subsequently searching for these records. The particular problem that I am facing is in dealing with (privacy) critical information like credit-card #s and SSNs or business critical information like sales opportunity size or revenue in the database. The requirement is that this data be stored encrypted...
8
1570
by: Stuart Clark | last post by:
Hello, I haven't done much with ASP but now I'm giving it a go! However, I'd like to ask if anybody knows if what I need to do is possible. I have a database with a lot of tables. Each table represents a customer. As customers come and go, so tables will be added and removed. I need to create a search utility that will search all tables for (e.g.) a customer name. I'm learning ASP so I'm not that advanced, but
33
2516
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following criteria: I have a list of about 100 numbers which correspond to the ID field and also another 40 say numbers corresponding to the numbers in the PRODUCT field. I want to show the rows that correspond to both these criteria.
4
1435
by: Jordan S. | last post by:
Using .NET 2.0 (C#) I'm writing a small app that will have a "Person" class that exposes FirstName and LastName properties. At runtime, a "People" collection will be populated with a few thousand "Person" objects. I want to provide users with the ability to search for people by FirstName and/or LastName. My question: How can I enable users to search for people with the last name of "De Leon". I cannot assume that my users know how to...
5
2405
by: justobservant | last post by:
When more than one keyword is typed into a search-query, most of the search-results displayed indicate specified keywords scattered throughout an entire website of content i.e., this is shown as three bolded periods '...' in search-result listings. Additionally, most content is outdated; as many users need up-to-date content. Hence, filtering-through search-results becomes quite cumbersome. The newsgroup listings allow detailed...
9
16374
by: ischwartz88 | last post by:
Hi, I am not a computer programmer. I have been learning VBA along the way of making this script. I know Access and SQL. I have a very large database with many tables and queries. My goal is to write a script or function that will search the entire database for a certain string (actually two strings). I have tried using a series of queries and unioning them together but this is a very scrappy way of doing this. Perhaps there is a method...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10329
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7500
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.