I am trying to move through records in a table using the ADODC tool. But I want to move through those records that occur on a specigic date, a date that was selected on a calandar using another form.
I was using the following code and I cannot get it to work.
Any Ideas?
Thank You in advance.
RecordSource = SELECT * FROM tblLog WHERE EventDate = #Forms!EditEntryByDate!calLog#
6 1464
I am trying to move through records in a table using the ADODC tool. But I want to move through those records that occur on a specigic date, a date that was selected on a calandar using another form.
I was using the following code and I cannot get it to work.
Any Ideas?
Thank You in advance.
RecordSource = SELECT * FROM tblLog WHERE EventDate = #Forms!EditEntryByDate!calLog#
Hello, opie!
I got just the thing. I urge you to search through the pages under adodc1...If it means looking through specific records, I can show you how to do this in DAO or you can look it up yourself here: -
-
Dim myDatabase As Database
-
Dim myRecord As Recordset
-
Set myDatabase = OpenDatabase("C:\DataMining\Data_Central.mdb")
-
Set myRecord = myDatabase.OpenRecordset("SELECT * FROM YourTable WHERE UserID='" & Text1(0).Text & "'")
-
-
You can turn UserID into the date field to search for specific date.
Please look for that post for added support. Adodc1 helps you page through the data... I thought to have read ADO is not that far off, you also fetch results here or Google on it; perhaps something of a difference between the two is posted.
Good luck:-)
Dököll
I have looked through the post several times. I cannot get this to work after about a week of working at it off and on.
It work fine when I insert the the exact date as the recordSource as shown below. - SELECT * FROM tblLog WHERE EventDate = #12/7/2007#
But when I try to refer it to a form that is still in memory (I have not unloaded the form) it gives me a syntax error. Now I am using MS Access Syntax so maybe that is the problem, but in this instance I figured it would be the same and I am unable to find the proper syntax. - SELECT * FROM tblLog WHERE EventDate = #forms!EditEntryByDate!calLog#
If your getting a data type error or the wrong records.
Try using
The CDate This converts the the record feild and criteria into the same date format. - WHERE Cdate(EventDate) = cdate(forms!EditEntryByDate!calLog)
Ps im not too sure about the " ' " that are needed.
i usually just use trial error.
When i first got this problem took me ages to find solution :)
Hope this helps you......... if not it may others.
Holiday Greetings
Daniel
I have looked through the post several times. I cannot get this to work after about a week of working at it off and on.
It work fine when I insert the the exact date as the recordSource as shown below. - SELECT * FROM tblLog WHERE EventDate = #12/7/2007#
But when I try to refer it to a form that is still in memory (I have not unloaded the form) it gives me a syntax error. Now I am using MS Access Syntax so maybe that is the problem, but in this instance I figured it would be the same and I am unable to find the proper syntax. - SELECT * FROM tblLog WHERE EventDate = #forms!EditEntryByDate!calLog#
Bummer, let's try to muscle through it then togheter, how's that for a deal?
Are you saying you did not find the post mentioned?
If you click on my handle and go through, has to be further in the pages, I'll race ya:-)
I am having look by the way because I must fire my notebook to get a real look...
Also there are bits of information you can use from others that have posted.
I'll attempt to type it up an try it.
In a bit!
Beat ya:-)
Alright, this is one of two links, my apologies I thought I had it all in one post...
I must fetch another old post:-) http://www.thescripts.com/forum/thre...65-adodc1.html
Got it. I decided to just strip it for spare parts, it is a rather large post... -
Private Sub cmdAdd_Click()
-
-
Dim my_database As Database
-
-
Set my_database = OpenDatabase("C:\Yoda1.mdb")
-
-
my_database.Execute "insert into Yoda1.Yoda(UserID, Name, Address, Phone, Email) Values('" & Text1.Text & "','" & Text2.Text & "' , '" & Text3.Text & "' , '" & Text4.Text & "','" & Text5.Text & "')"
-
my_database.Close '
-
-
Text1.Text=""
-
Text2.Text=""
-
Text3.Text=""
-
Text4.Text=""
-
Text5.Text=""
-
-
End Sub
-
You'll need to reference DAO 3.6, I think.
So if you have a date field in your access database, you should be able to load into VB using this code.
Try it, and good luck:-)
Beat ya:-)
Alright, this is one of two links, my apologies I thought I had it all in one post...
I must fetch another old post:-) http://www.thescripts.com/forum/thre...65-adodc1.html
Got it. I decided to just strip it for spare parts, it is a rather large post... -
Private Sub cmdAdd_Click()
-
-
Dim my_database As Database
-
-
Set my_database = OpenDatabase("C:\Yoda1.mdb")
-
-
my_database.Execute "insert into Yoda1.Yoda(UserID, Name, Address, Phone, Email) Values('" & Text1.Text & "','" & Text2.Text & "' , '" & Text3.Text & "' , '" & Text4.Text & "','" & Text5.Text & "')"
-
my_database.Close '
-
-
Text1.Text=""
-
Text2.Text=""
-
Text3.Text=""
-
Text4.Text=""
-
Text5.Text=""
-
-
End Sub
-
You'll need to reference DAO 3.6, I think.
So if you have a date field in your access database, you should be able to load into VB using this code.
Try it, and good luck:-)
Sorry wrong code, you need SELECT FROM, I have been doing this lately, fogetting stuff:-) -
-
'this is searching for existing data in your access
-
-
Private Sub Seek_Click() 'this is your button
-
Dim my_database As Database 'dimension database as database
-
Dim my_record As Recordset 'dimension recordset as recordset
-
-
Set my_database = OpenDatabase("C:\DataMining\Yoda.mdb")
-
-
'You can change above path/folder name to location of your own access
-
'database
-
-
'Going forward, above function will open your database
-
'Make sure your databse is closed
-
-
Set my_record = my_database.OpenRecordset("select * from Yodamania where UserID like '" & Text1.Text & "'") ' this is used to search by user id
-
-
Do While Not my_record.EOF
-
-
'this function will keep searching for fields matching each textbox
-
-
Text1.Text = my_record.Fields("UserID")
-
Text2.Text = my_record.Fields("Name")
-
Text3.Text = my_record.Fields("Address")
-
Text4.Text = my_record.Fields("Phone")
-
Text5.Text = my_record.Fields("Email")
-
-
my_record.MoveNext
-
Loop
-
my_database.Close
-
End Sub
-
-
Remember to use DAO, you will get an error without a reference; I am sure you know that, just saying it before I forget:-)
Also, rest assure your adodc1 control will work just fine with DAO...
In a bit!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Meher Malakapalli |
last post by:
Hi
I have an application built in VB6. It uses an adodc control bound to
several other controls. After installing the .NET framework, the
application's data-bound controls no longer display the...
|
by: Raoul Watson |
last post by:
I have a form with an AdoDc control associated to a datagrid.
The AdoDC uses a "ConnectionString" such as
"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data
Source=..."
this is...
|
by: Ariane |
last post by:
I have an ADODC object in my form which populates a datagrid.
I set the coonection string for ADODC at design time.
The problem is that I have no way to close the connection when i exit the...
|
by: blobi |
last post by:
i tried to use adodc with unknown recordsource but it couldn't work when i was using datagrid with adodc as datasource. "ADO can not set for the command text".
why i failed for using adodc with...
|
by: techie2 |
last post by:
Can you help me to handle the error with ADODC?
When I run any form which has ADODC on it I get an 'Operation was cancelled' or 'Could not find installable isam' errors.
How to eliminate these...
|
by: yosh29rs |
last post by:
I have been using Adodc recently to link my system in vb6 to my detabase until our professor required us recently to use SQL which is completely new to me and ive never encountered before. How is it...
|
by: yosh29rs |
last post by:
I have been using Adodc recently to link my system in vb6 to my detabase until our professor required us recently to use SQL which is completely new to me and ive never encountered before. How is it...
|
by: yosh29rs |
last post by:
I have been using Adodc recently to link my system in vb6 to my detabase until our professor required us recently to use SQL which is completely new to me and ive never encountered before. How is it...
|
by: hussainiyad |
last post by:
Dear all,
i,m new to v.b and i tried to connect to sqlserver through adodc in a datagrid or datalist , but there was no result in my form, can any one tell me what's the reason and i done every...
|
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:
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...
|
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,...
|
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: 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...
|
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,...
|
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...
| |