🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4911

Errors exporting functions to access an Access DB

#4911
From: Mike Coldewey
Date: Wed, 29 Aug 2001 21:01
45 lines
2342 bytes
I am writing a DLL that tries to expose methods to access an Access
database: here is much of the code:

void _export OpenADBDB();
void _export CloseADBDB();
void OpenADBDB()
{
    if (isOpen) return;
    ADBConn = new TADOConnection(NULL);
    ADBConn->ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=F:\apps\adbmdb\adb.mdb";
    ADBConn->LoginPrompt = false;
    ADBConn->Open("","");
    isOpen = true;
}
void CloseADBDB()
{
    if (!isOpen) return;
    ADBConn->Close();
    isOpen = false;
    delete ADBConn;
}

If I eliminate the prototypes
void _export OpenADBDB();
void _export CloseADBDB();
everything links, but I don't export any functions. If I have those lines in
the code, I get the following errors:

[Linker Error] Unresolved external 'Adodb::TADOConnection::' referenced from
F:\APPS\ADBMDB\DLL\ASSETADB.OBJ
[Linker Error] Unresolved external '__fastcall
Adodb::TADOConnection::TADOConnection(Classes::TComponent *)' referenced
from F:\APPS\ADBMDB\DLL\ASSETADB.OBJ
[Linker Error] Unresolved external '__fastcall
Adodb::TADOConnection::SetConnectionString(const System::WideString)'
referenced from F:\APPS\ADBMDB\DLL\ASSETADB.OBJ
[Linker Error] Unresolved external '__fastcall
Adodb::TADOConnection::Open(const System::WideString, const
System::WideString)' referenced from F:\APPS\ADBMDB\DLL\ASSETADB.OBJ

Why does just trying to export functions create these linking errors, and is
there a documented workaround for this?

Mike
Technical Details
Message-ID: <3b8d5783_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,69b354d3c725b4c8,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-08-29 14:01:43 PST
From: "Mike Coldewey" <No_Spam4m_coldewey@hotmail.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Errors exporting functions to access an Access DB
Date: Wed, 29 Aug 2001 16:01:08 -0500
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 207.88.203.226
Message-ID: <3b8d5783_2@dnews>
X-Trace: dnews 999118723 207.88.203.226 (29 Aug 2001 13:58:43 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews