473,406 Members | 2,847 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,406 software developers and data experts.

Display records between two dates of ms-access database using vb6.0

Expand|Select|Wrap|Line Numbers
  1. SQL = "SELECT * FROM Expences WHERE ((('Month') Between # " & DTPicker1.Value & "# And # " & DTPicker2.Value & "#))"
  2.    RS.Open , SQL, Conn, adOpenForwardOnly, adLockReadOnly
  3.  
  4.     With DataReport5.Sections("Section1").Controls 'section1 mean that section you create in datareport
  5.    .Item("Text1").DataField = RS("ID").Name
  6.    .Item("Text2").DataField = RS("Month").Name
  7.    .Item("Text3").DataField = RS("Expenditure").Name
  8.    .Item("Text4").DataField = RS("Purpose").Name
  9.    .Item("Text5").DataField = RS("Amount").Name
  10.  
  11.  
  12.  
  13.    End With
  14.  
  15.     Set DataReport5.DataSource = RS
  16.     DataReport5.Show
but is doesn't shows any records on the data report
Nov 2 '13 #1
1 6309
9815402440
180 100+
you can not filter dates writing query in vb6 code. you have three methods:
first: write parametrised query in ms access that takes two date type parameters and filters data as desired. in vb6 code pass dates as parameter to ms-access query. in this case ms-access will return the filtered data.
second: use data environment designer and make parametrised query
third (not preferred): save date as yyyymmdd in a number field and then filter data as "where date >= 20130412 and date <= 20130512"

hope this will help you
-----------------------
Manpreet Singh Dhillon
Nov 2 '13 #2

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

Similar topics

4
by: Lucky | last post by:
I have a vb.net windows app that connects to an access database. The database has 1 table. One of the columns is called "Address". A user enters any address into a textbox (txtValue) then clicks...
1
by: balachander | last post by:
i every one, i have problem while creating crystal report using vb.net. this is the problem how can i display only one record using crystal report.but i can able to display all the reocord that...
17
by: kartheek | last post by:
hi friends, can any one out here help me by giving me the code to connect to an MSACCESS database using javascript.
8
by: menmysql | last post by:
i am not bale to solve this problem since two weeks i am trying to access records from mysql database using jsp. inside this jsp program i wrote all my JDBC code. it is working very nicely and...
6
by: Reccy | last post by:
Hi... I have a problem regarding updating table rows on the database (MSAccess)... I could do a select query but when i use update... the rows are not updating... how could i solve this?...
0
by: mrsoft100 | last post by:
Dear Members I have written a program whose intention is to track fee payment by students in a school. the program is intended to track as many students as possible. My program works very well and...
4
selvasoft
by: selvasoft | last post by:
Hi Please help me i want display all images from my database. but here my code that will display only one image from database. But i want all images, any one help me. <html> <head>...
0
selvasoft
by: selvasoft | last post by:
Hi Please help me any one. I want solution for display multiple images from oracle database.Using JSP. here is my code for display one image from database. Please Any one give me some ideas. ...
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
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.