Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dao Issues

Status
Not open for further replies.

scoot2

Technical User
Feb 23, 2003
1
US
Hello. I have 2 questions which are unfortunetly both important for my application.

1)

I was recently surprised to see that my Visual c++ 6 doesnt work with Access2000. I searched the web, and found that the problem is because I dont have the upgraded Dao 3.6. So I downloaded the 130 mb service pack4, followed the installation instructions, built the dll that I was asked to build in the readme file, but nothing happened. I still can't open jet 4.0(access 2000 uses this engine) database, because c++ doesnt recognize it. Actually nothing has changed. Maybe I missed something. Any help would be highly appreciated.

2)

I was planning to retrieve a record using a SQL query.
That was the code I used:

------------------------------------------------------------------------------------
CString MySql = "SELECT * FROM Departments WHERE ManagerID = 'JENKINS001'";
CDaoRecordSet Managers(MyDatabase);
Managers.Open(dbOpenDynaset, MySql);
------------------------------------------------------------------------------------


Great, now I have a record in the Departments table where the ManagerID field is JENKINS001. But now, how can I retrieve the record, work with it, see its fields. I want to output one of its fields, compare it with another string. How can I do this? if GetFieldValue returns a "COleVariant" and not "CString"?


Thank you.
 
Dear Scoot2,

> I was recently surprised to see that my Visual c++ 6 doesnt work with Access2000.

Not much of a surprise since VC++ 6 was released long before Access 2000. Anyhow, I believe all can be set right if you download the latest MDAC from a little known knowledge base web site, msdn.microsoft.com

> But now, how can I retrieve the record, work with it, see its fields.

Well, you will have to learn the DAO API, just like you would any other API that you want to start working with. There are samples that ship with VC++ 6.0 as well as many more at the previously mentioned top secret web site msdn.microsoft.com

Alternatively you might want to work with ADO rather than DAO. If you want to check it out there is a FAQ for this forum that contains some ADO information. Of course there are samples and technical articles aplenty at... where? msdn.microsoft.com of course!

Hope this helps
-pete


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top