Hi everybody, I want to retrieve the details from the database by the date from (MM/DD/YYYY) to (MM/DD/YYYY). For that I have to change the following code as follows - rs.Open "select * from Table where empid='" & Text1.Text & "'", con
So kindly anyone reply me.
11 1600
Hi everybody, I want to retrieve the details from the database by the date from (MM/DD/YYYY) to (MM/DD/YYYY). For that I have to change the following code as follows rs.Open "select * from Table where empid='" & Text1.Text & "'", con
Do you need to do this instead of the empid, or the two together? Here are some ideas... - Just the date range
- rs.Open "select * from Table where DateField Between #" & _
-
strStartDate & "# AND #" & strEndDate & "#", con
- Both
- rs.Open "select * from Table where empid = '" & Text1.Text & _
-
"' AND DateField Between #" & strStartDate & "# AND #" & _
-
strEndDate & "#", con
I'm assuming here that your dates are in string variables, already formatted as MM/DD/YYYY.
And you are assuming it is an Access database
And you are assuming it is an Access database
Guilty.
I do tend to think in terms of VB6 and Access, and if people aren't specific, I figure they'll just have to make do with what they get. :)
Do you need to do this instead of the empid, or the two together? Here are some ideas...- Just the date range
- rs.Open "select * from Table where DateField Between #" & _
-
strStartDate & "# AND #" & strEndDate & "#", con
- Both
- rs.Open "select * from Table where empid = '" & Text1.Text & _
-
"' AND DateField Between #" & strStartDate & "# AND #" & _
-
strEndDate & "#", con
I'm assuming here that your dates are in string variables, already formatted as MM/DD/YYYY.
I tried with that codigs.But run time error has occured as "Too few parameters required".So kindly give me the suggestion for that.
i thing there is no error in the above query
replace the code with this one - rs.Open "select * from Table where empid = '" & Text1.Text & _
-
"' AND DateField Between #" & strStartDate & "# AND #" & _
-
strEndDate & "#", con,adOpenForwardOnly ,adLockReadOnly
i thing there is no error in the above query
replace the code with this one - rs.Open "select * from Table where empid = '" & Text1.Text & _
-
"' AND DateField Between #" & strStartDate & "# AND #" & _
-
strEndDate & "#", con,adOpenForwardOnly ,adLockReadOnly
I used two text boxes to get the date from the MonthView control.
So i have written the code is - rs.Open "select * from tbl where empid = '" & Text1.Text & "' AND DateField Between #" & Text2.Text & "# AND #" & Text3.Text & "#", con, adOpenForwardOnly, adLockReadOnly
Eventhough the same error has occured.So kindly reply me
It may be that you have not adjusted our field names to match your own. For example, I used the name DateField because I don't know what yours is called. If your field name is not DateField then you will need to change this.
If that's not the problem, we'll have to investigate further.
Note, if you're going to post an error message, make sure you copy it precisely. I suspect that "Too few parameters required" is not quite the wording Access used (though as always, I could be wrong).
It may be that you have not adjusted our field names to match your own. For example, I used the name DateField because I don't know what yours is called. If your field name is not DateField then you will need to change this.
If that's not the problem, we'll have to investigate further.
Note, if you're going to post an error message, make sure you copy it precisely. I suspect that "Too few parameters required" is not quite the wording Access used (though as always, I could be wrong).
I have written the following code to retrieve and display the details into the ListView control. - rs3.Open "select * from tbl where empid = '" & Text1.Text & "' AND dat Between #" & Text2.Text & "# AND #" & Text3.Text & "#", con, adOpenForwardOnly, adLockReadOnly
-
rs.MoveFirst
-
Do Until rs.EOF
-
j = j + 1
-
lv.ListItems.Add j, , j
-
lv.ListItems(j).SubItems(1) = rs!empid
-
lv.ListItems(j).SubItems(2) = rs1!firstname & rs1!lastname
-
lv.ListItems(j).SubItems(3) = rs3!dat
-
lv.ListItems(j).SubItems(4) = rs3!intime
-
lv.ListItems(j).SubItems(5) = rs3!outtime
-
rs.MoveNext
-
Loop
But I couldnt retrieve all the details from the database table.
I could retrieve only the same data repeatedly until the EOF.For that how can I retrieve the full details from the table.So kindly reply me
When you are posting code please use code tags. Clearly you are highlighting your code and clicking on the center justify and bold buttons. Please don't do that. Click on the '#' button instead. This is the third time I have added code tags to your posts
Thanks
When you are posting code please use code tags. Clearly you are highlighting your code and clicking on the center justify and bold buttons. Please don't do that. Click on the '#' button instead. This is the third time I have added code tags to your posts
Thanks
ok thanks.
I got the solution for that.
When you are posting code please use code tags. Clearly you are highlighting your code and clicking on the center justify and bold buttons. Please don't do that. Click on the '#' button instead. This is the third time I have added code tags to your posts
Thanks
I can retrieve all the details from the table by using the following code. -
rs3.Open "select * from tbl where empid = '" & Text1.Text & "' AND dat Between #" & Text2.Text & "# AND #" & Text3.Text & "#", con, adOpenForwardOnly, adLockReadOnly
-
rs3.MoveFirst
-
Do Until rs3.EOF
-
j = j + 1
-
lv.ListItems.Add j, , j
-
lv.ListItems(j).SubItems(1) = rs!empid
-
lv.ListItems(j).SubItems(2) = rs1!firstname & rs1!lastname
-
lv.ListItems(j).SubItems(3) = rs3!dat
-
lv.ListItems(j).SubItems(4) = rs3!intime
-
lv.ListItems(j).SubItems(5) = rs3!outtime
-
rs3.MoveNext
-
Loop
But Now I want take the printout of what are the date listed inside the ListView control by clicking one command button.So kindly give me the suggestion for that.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Richard Cornford |
last post by:
For the last couple of months I have been trying to get the next round
of updates to the FAQ underway and been being thwarted by a heavy
workload (the project I am working on has to be finished an...
|
by: Andrew |
last post by:
I use conditional compiler constants, set through the VBA IDE in
Tools, <projectname> Properties, that I refer to throughout my code to
control which code is used during development, and which...
|
by: pjac |
last post by:
I need some help with some VB language that will change the screen
resolution on a monitor when a MS-Access 2000 database is opened from
1024 x 768 to 800 x 600.
Any help with this effort would be...
|
by: Smith Duggan |
last post by:
I am attempting to change the background properties of a rectangle in
the code, and have been stuck now for a day and a half. This is my
first access app. Please be gentle with my steaming pile...
|
by: lauren quantrell |
last post by:
Is there a way to force a change in a user's screen resolution using
VBA code without having any input from the user?
Example: User John Backwards has his screen set to 800 x 600 pixels.
Backwards...
|
by: Fabrizio |
last post by:
(Sorry for the crosspost, but I really don't know which is the right
newsgroup!)
Hi all,
I try to change the password to a user that as to change the password at
first logon:
try
{
|
by: Alpha |
last post by:
I have several textboxes that I need to chang the text when the selection row
is changed in a datagrid. I have the following code. This textbox displayes
the initial selection but when I click on...
|
by: Sanjeeva Reddy |
last post by:
hai Anti Keskinen,
i have used
the following code MyListView->LargeImageList->ImageSize = gcnew
System::Drawing::Size(100,
100); // Sets large image size to 100, 100
here i am getting error...
|
by: Tom |
last post by:
I am writing a Visual basic .Net database application.
There are many forms that first let you select and look at
a DB record and then when you click a "modify" button you
are allowed to change...
|
by: Martin Pritchard |
last post by:
Hi,
Sorry for my ignorance, but I'm a bit new to C++.
I've been handed over a C++ app written in VS2002 which I have to convert to
VS2005. Apparently it's been written in a C style, but cannot...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
| |