dao 3.6 in visual studio 6

P

perry59

I am a novice C++ programmer, making dll's for use in AutoCad.
I am currently extracting some info from drawings and writing it out to
an access database.
What I have done works fine, with the exception that it creates an
access97 file. Since everyone here is using access 2000 there is a
compatibility problem. I had read that it was possible to force MFC to
use the dao 3.6 with the following code snippet....

//try to force use of DAO 3.6
#ifdef _AFXDLL
AFX_MANAGE_STATE(AfxGetModuleState()->m_dwVersion = 0x0601); //syntax
error : missing ';' before '->'
#else
AFX_MANAGE_STATE(AfxGetStaticModuleState()->m_dwVersion =
0x0601); //syntax error : missing ';' before '->'
#endif
AfxDaoInit();

However, as you can see by my comments, I get comiler errors. I am
assuming I have this problem because I am creating a .dll as opposed to
a standalone app. (using MFC as a shared dll). Is this true? If so, how
would I modify the above code to work in my project?
Thanks for any help.
 
V

Victor Bazarov

perry59 said:
I am a novice C++ programmer, making dll's for use in AutoCad.
I am currently extracting some info from drawings and writing it out to
an access database.
What I have done works fine, with the exception that it creates an
access97 file. Since everyone here is using access 2000 there is a
compatibility problem. I had read that it was possible to force MFC to
use the dao 3.6 with the following code snippet....

//try to force use of DAO 3.6
#ifdef _AFXDLL
AFX_MANAGE_STATE(AfxGetModuleState()->m_dwVersion = 0x0601); //syntax
error : missing ';' before '->'
#else
AFX_MANAGE_STATE(AfxGetStaticModuleState()->m_dwVersion =
0x0601); //syntax error : missing ';' before '->'
#endif
AfxDaoInit();

However, as you can see by my comments, I get comiler errors. I am
assuming I have this problem because I am creating a .dll as opposed to
a standalone app. (using MFC as a shared dll). Is this true? If so, how
would I modify the above code to work in my project?

ADO, DLL, Access, Autocad, MFC, are all off-topic here. However, it seems
that your problem is simply that 'AfxGet[Static]ModuleState' is either
undefined or returns a pointer to an incomplete type. Since that function
(if it's a function) is not a standard C++ function, we can't help you.
Try asking in an MFC newsgroup: 'microsoft.public.vc.mfc'.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top