What does this code do?
Oct 29, 2012 at 2:46pm UTC
I'm looking through a program for school, and I found this code inside it:
2 3 4 5 6 7 #import "C:\Program Files\Common Files\System\ado\msado15.dll" \
ADODB::_ConnectionPtr DBConnect = NULL;
ADODB::_RecordsetPtr Rec = NULL;
Can anyone explain what all this does? I know that the #import statement will load a dll file, but I don't know what that dll does. I also know that DBConnect and Rec look like they're pointers, but again, what do they do? Also, what is a HRESULT object used for? If you need me to provide more code from this program, I'd be glad to do so.
Oct 29, 2012 at 3:03pm UTC
Here are the functions included in that DLL:
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Courtesy of Nirsoft's DLL Export Viewer.
'_ConnectionPtr' and '_RecordsetPtr' are data types from the ADODB namespace that are being initialized to NULL. What they do is pretty evident given their name.
Oct 29, 2012 at 3:09pm UTC
What they do is pretty evident given their name.
Not to me. I've never messed with this kind of stuff. I know that _ConnectionPtr is obviously supposed to connect to something, but to what? And how does it do that?
*edit* When I say, "To what?" I mean, is it a database? Is it a website? You know what I mean?
Last edited on
Oct 29, 2012 at 3:10pm UTC
Oct 29, 2012 at 3:21pm UTC
ADO = ActiveX Data Object, so yeah I assume it's a connection to a database. As for "how it does that", I'm not a .Net programmer so I've had no reason to take this particular library apart.
Oct 29, 2012 at 3:26pm UTC
Ok, thanks for the info. This helped a bit :)
Topic archived. No new replies allowed.