Adding a date to a DAO table

I am adding records to a MS Access table with VC 6.0. I am able to set all my fields except a date field. I have tried adding the record as a string

m_pSet->DateField = "01/27/99";

I have also tried to insert it as a CTime object in various format but It will now allow me.

Am I missing a simple concept here?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lgalmaAuthor Commented:
I forgot to mention that I also tried placing # on the outside of the string.

Try this :

m_pSet->DateField.SetDate(99, 1, 27);


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DateField is an object of COleDateTime. Use members of COleDateTime to manipulate DateField.

You can set the input mask of the DateField field in the access table to suit your need. In that case you may have to use other functions like SetDateTime() etc instead of SetDate() depending on your input mask.
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

lgalmaAuthor Commented:
AHHHHHH!!! That makes sence. Thank you...  Does that go for ODBC also?
It should work as long as DateField is an object of COleDateTime. You just have to check the type in Member Variable tab of class wizard. If it is COleDataTime, use these member functions. If it is some other type, find the member functions for that class.
lgalmaAuthor Commented:
It's coming together. Thanks...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.