import ADO DLL

import ADO DLL

am 15.04.2008 05:55:01 von Jim Johnson

I have an application that needs to import a DLL file for some
database call like -

#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
rename("EOF", "EndOfFile")

the path is OS dependent - what if I run on some other PC but the
msado15.dll is not specificed in the path specified? for this case -
#import "c:\Program Files\Common Files\System\ADO\

any easy way to work around this problem where I don't have a hard
coded path in my code??



============

#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
rename("EOF", "EndOfFile")

typedef ADODB::_RecordsetPtr RecPtr;
typedef ADODB::_ConnectionPtr CnnPtr;

class Database;
class Table;

class Database
{
public:
CnnPtr m_Cnn;
char m_ErrStr[500];
Database();
bool Open(char* UserName, char* Pwd,char* CnnStr);
bool Execute(char* CmdStr, Table& Tbl);
void GetErrorErrStr(char* ErrStr);
};

class Table{
public:
RecPtr m_Rec;
char m_ErrStr[500];
Table();
void GetErrorErrStr(char* ErrStr);
int ISEOF();
HRESULT MoveNext();
HRESULT MovePrevious();
HRESULT MoveFirst();
HRESULT MoveLast();

bool Get(char* FieldName, char* FieldValue);
bool Get(char* FieldName,SYSTEMTIME& FieldValue);
bool Get(char* FieldName,int& FieldValue);

BOOL VariantTimeToSystemTimeWithMilliseconds (/*input*/ double
dVariantTime, /*output*/SYSTEMTIME *st);
};

Re: import ADO DLL

am 15.04.2008 15:08:56 von Morten

Jim Johnson skrev:
> I have an application that needs to import a DLL file for some
> database call like -
>
> #import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
> rename("EOF", "EndOfFile")
>
> the path is OS dependent - what if I run on some other PC but the
> msado15.dll is not specificed in the path specified? for this case -
> #import "c:\Program Files\Common Files\System\ADO\
>
> any easy way to work around this problem where I don't have a hard
> coded path in my code??
>

Distribute the DLL with your code and reference it from a directory of
your chosing?

Best,

Morten