What does this code do?

Hello people,
I'm looking through a program for school, and I found this code inside it:
1
2
3
4
5
6
7
#import "C:\Program Files\Common Files\System\ado\msado15.dll" \
rename("EOF", "EndOfFile")

ADODB::_ConnectionPtr DBConnect = NULL;
ADODB::_RecordsetPtr Rec = NULL;

HRESULT hr;

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.
Here are the functions included in that DLL:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
RNIGetCompatibleVersion
DllUnregisterServer
DllRegisterServer
DllGetClassObject
DllCanUnloadNow
com_ms_wfc_data_Field_setDataDate
com_ms_wfc_data_Field_loadMsjava
com_ms_wfc_data_Field_isNull
com_ms_wfc_data_Field_getString
com_ms_wfc_data_Field_getShort
com_ms_wfc_data_Field_getLong
com_ms_wfc_data_Field_getInt
com_ms_wfc_data_Field_getFloat
com_ms_wfc_data_Field_getDouble
com_ms_wfc_data_Field_getDataTimestamp
com_ms_wfc_data_Field_getBytes
com_ms_wfc_data_Field_getByte
com_ms_wfc_data_Field_getBoolean

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.
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
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.
Ok, thanks for the info. This helped a bit :)
Topic archived. No new replies allowed.