ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADO newbie

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
293 Views, 10 Replies

ADO newbie

Im still pretty green when it comes to C++/Arx and have NEVER done anything with ADO.
I do want to incorporate it into a project though. Could anyone provide me with a bit
of sample code to get me started? Just the basics, proper way of integrating the classes
into an Arx project, instantiating/destroying the DB objects, perhaps writing an attribute
or other data to the DB. Any help would be appreciated.
Thanks
perry
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

The arx download is loaded with samples and tutorials... it really is the best way to learn.
Message 3 of 11
Anonymous
in reply to: Anonymous

Shazam wrote:
> The arx download is loaded with samples and tutorials... it really is the best way to learn.
Well Shazam! I never thought of that. I bet the sdk and docs are just loaded
with info on integrating external databases in Arx are'nt they?
Message 4 of 11
Anonymous
in reply to: Anonymous

Have you considered getting some training in C++/ADO?

There's really no connection between ADO and ObjectARX.

They're two completely separate topics, so I'm not sure
why one would be asking for help on learning ADO here,
rather than in a forum or online resource where ADO is
the main topic.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"perry" wrote in message news:5053065@discussion.autodesk.com...
Im still pretty green when it comes to C++/Arx and have NEVER done anything with ADO.
I do want to incorporate it into a project though. Could anyone provide me with a bit
of sample code to get me started? Just the basics, proper way of integrating the classes
into an Arx project, instantiating/destroying the DB objects, perhaps writing an attribute
or other data to the DB. Any help would be appreciated.
Thanks
perry
Message 5 of 11
Anonymous
in reply to: Anonymous

Tony Tanzillo wrote:
> Have you considered getting some training in C++/ADO?
>
> There's really no connection between ADO and ObjectARX.
>
> They're two completely separate topics, so I'm not sure
> why one would be asking for help on learning ADO here,
> rather than in a forum or online resource where ADO is
> the main topic.
>
Thats true Tony, and I wouldnt want to ask purely ADO questions here when there is a wealth
of info regarding that topic in other forums. In fact Im currently working on integrating a
couple custom ADO classes (from "the code project") into my current Arx project.
I was just looking for any "trick" in working it into an Arx (dll) which is of course
different than a standalone windows program.
Message 6 of 11
Anonymous
in reply to: Anonymous

>> I was just looking for any "trick" in working it into
>> an Arx (dll) which is of course different than a
>> standalone windows program.

In terms of ADO and how it is used from either a
DLL/ARX and an executable, there is no difference.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
Message 7 of 11
Anonymous
in reply to: Anonymous

Tony Tanzillo wrote:
>>>I was just looking for any "trick" in working it into
>>>an Arx (dll) which is of course different than a
>>>standalone windows program.
>
>
> In terms of ADO and how it is used from either a
> DLL/ARX and an executable, there is no difference.
>

for example. I downloaded a couple classes as mentioned before.
In order to use them I had to link in the ADO libraries, ok, no problem.
As soon as I did that I got linker errors, seems the ADO libraries had
nearly identical names to some standard libs I already had and they
didnt play nicely together. So I resolved that through the use of the
/NODEFAULTLIB switch. Now it compiles just hunky dory. Until I load
Acad. Now Acad complains with...

Warning: C:\Documents and Settings\perry\My Documents\My code\C++\Acad\tblocker
2002\Debug\tblocker2002.arx allocates memory from MSVCRTD.DLL, but AutoCAD uses
memory from MSVCRT.DLL.
This may cause problems.

So, if Acad doesnt like me using MSVCRTD, which came in with the ADO libs,
what am I supposed to do? Sounds pretty AutoCad specific to me. I know other
people have used ADO with Acad, how did they get around this?
Guess I could go to generic ODBC.
Thats why I was hoping to get my hands on a simple Arx/ADO project so I could see
how it was set up! If I need help with ADO, I will go elsewhere.
Perry
Message 8 of 11
Anonymous
in reply to: Anonymous

"perry" wrote ...

> So, if Acad doesnt like me using MSVCRTD, which came in with the ADO libs,
> what am I supposed to do?

This is just a guess, but I think maybe AutoDesk is using ADO to access
their databases in DWG. Or at least it looks to me like their using ADO.NET
in the managed libraries, so if you're going to use ADO I suppose you need
to try working with the same libraries.

--
Regards,

Fred Chateau
fchateauAtComcastDotNet
Message 9 of 11
Anonymous
in reply to: Anonymous

perry wrote:

> So, if Acad doesnt like me using MSVCRTD, which came in with the ADO libs,
> what am I supposed to do? Sounds pretty AutoCad specific to me. I know other
> people have used ADO with Acad, how did they get around this?
> Guess I could go to generic ODBC.
> Thats why I was hoping to get my hands on a simple Arx/ADO project so I could see
> how it was set up! If I need help with ADO, I will go elsewhere.
> Perry
What class from Code Project are you using, CADODatabase, etc.?

If the wrapper class uses MFC (which apparently it does) you need to
make sure that any MFC header #includes (afx...h) in the source are
either moved to your stdafx.h or you use the same _DEBUG workaround as
found in stdafx.h so you don't link with the debug MFC libraries.

--
Best regards,

Byron Blattel
CADwerx--Applications for AutoCAD
Autodesk Registered Developer
Contact Info @ http://www.cadwerx.net
Custom Programming Services - ObjectARX/C++/MFC/ASP/STL/ATL/ISAPI...
Message 10 of 11
Anonymous
in reply to: Anonymous

Well, not sure what the problem there was.
I basically started over from scratch, removed all the ADO
stuff and reset the libraries and got a clean compile.
Then I imported the libs again and got NO conflict, so I'm
using the standard libs again with ADO. The only thing I did
different was this time I did not set the path in .
Just included the full path in the import statements.
Still having trouble though with the custom classes I got from
"the code project" (AdoClass220 & AdoxClass). So I will just
use MFC routines till I get the hang of it.
Perry
Message 11 of 11
Anonymous
in reply to: Anonymous

"Fred Chateau" wrote

>> "perry" wrote ...

>>>> So, if Acad doesnt like me using MSVCRTD,
>>>> which came in with the ADO libs, what am
>>>> I supposed to do?

>> This is just a guess, but I think maybe AutoDesk is using
>> ADO to access their databases in DWG. Or at least it looks
>> to me like their using ADO.NET in the managed libraries,
>> so if you're going to use ADO I suppose you need to try
>> working with the same libraries.

Autodesk's use of ADO.NET in managed code has absolutely
nothing to do with using ADO in native code.

The problem here is mixing of debug and release libraries,
and is easily solved by using preprocessor macros to always
compile the conflicting libraries in release mode.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost