import ADO DLL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Johnson

    import ADO DLL

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

    #import "c:\Program Files\Common Files\System\AD O\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\AD O\

    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\AD O\msado15.dll" \
    rename("EOF", "EndOfFile" )

    typedef ADODB::_Records etPtr RecPtr;
    typedef ADODB::_Connect ionPtr 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,SYSTE MTIME& FieldValue);
    bool Get(char* FieldName,int& FieldValue);

    BOOL VariantTimeToSy stemTimeWithMil liseconds (/*input*/ double
    dVariantTime, /*output*/SYSTEMTIME *st);
    };

  • Morten

    #2
    Re: import ADO DLL

    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\AD O\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\AD O\
    >
    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

    Comment

    Working...