473,378 Members | 1,416 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

dao 3.6 in visual studio 6

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.

Feb 10 '06 #1
1 2394
perry59 wrote:
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
--
Please remove capital As from my address when replying by mail
Feb 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
2
by: Cramer | last post by:
So, what is the relationship between Visual Studio and Visual Web Developer. I find a lot of documentation on MSDN that presents Visual Web Developer as it's own stand-alone product (which I'd...
3
by: Johnson | last post by:
I'm not sure if this is an IIS 5.1 issue or ASP.NET issue, or Visual Studio 2008 issue -- thus posting to 3 groups. Please don't be offended. The problem I'm encountering is that Visual Studio...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.