September 20th, 2010, 07:10 AM
#1
Date control with SQL embeded in VC++
Hi,
I am doing programming with VC++ 2008, it needs to access ACCESS file with date control.
I pasted a "Date Time Picker" in MFC project. My intent is to retreave the value of the selected date in "D/T Picker" and search in database by this value of date. How? Any better solution?
A second question, how to transfer number between VC++ and SQL?
Thank you.
Sunny
Last edited by sunnyyang; September 20th, 2010 at 07:15 AM .
September 20th, 2010, 07:15 AM
#2
Re: Date control with SQL embeded in VC++
Create a CRecordset derived class to access your Access table.
Get the date from the control.
Use the m_strFilter member of your CRecordset class to filter the records by date.
Call Requery to select the records.
September 20th, 2010, 09:04 AM
#3
Re: Date control with SQL embeded in VC++
Hm... That sounds the understanding in the way I am thinking of. Well, but I am still new on VC++, so would you mind to explain further?
Thank you.
September 20th, 2010, 09:24 AM
#4
Re: Date control with SQL embeded in VC++
Originally Posted by
sunnyyang
Hm... That sounds the understanding in the way I am thinking of. Well, but I am still new on VC++, so would you mind to explain further?
Thank you.
MSDN explains it better than I can. Take it a step at a time. Can you get the date from your control?
September 20th, 2010, 11:11 PM
#5
Re: Date control with SQL embeded in VC++
Originally Posted by
GCDEF
MSDN explains it better than I can. Take it a step at a time. Can you get the date from your control?
Yes, I can get the date from the control, it's an object under CString (example: 2010-9-20 or 2010920).
I have one step from getting SQL to recognize the date format.
September 21st, 2010, 07:19 AM
#6
Re: Date control with SQL embeded in VC++
You need to give us some details here. How much do you have and how much do you still need?
Are you using a CDateTimeCtrl object?
How are you getting to your database?
September 29th, 2010, 04:59 AM
#7
Re: Date control with SQL embeded in VC++
I am a little engaged these days. Let me get better prepared first then I answer these questions. Thank you for helping, will get back soon.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width
Bookmarks