🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Linking Tables to an MSAccess Database in Code

#1840
From: Viatcheslav V. Vassiliev
Date: Thu, 22 Jan 2004 13:25
53 lines
2708 bytes
This should help:

    Adox_tlb::Property* ppvObject;
    OLECHECK(tbl->Properties->get_Item(WideString("Jet OLEDB:Create Link",
(Adox_tlb::Property**)&ppvObject));
    ppvObject->Value = ...

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Robert Emmons" <remmons@aurigen.com> ???????/???????? ? ???????? ?????????:
news:pu5t00drncdrn41hnftvesb6nviv7pjs4l@4ax.com...
> I am back to this problem again.  I would like to write some code to
> refresh the links to tables in an MSAccess database.  Thanks to
> Viatcheslav V. Vassiliev, I have some of the code needed, but I have
> not been able to get it to work yet.
>
> This code compiles (after including ADOX_TLB.h):
>
>     Adox_tlb::TCOM_Catalog cat = CoCatalog::Create();
>     cat->Create(WideString("Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=" + thisDb));
>
>     Adox_tlb::TCOM_Table tbl = CoTable::Create();
>     tbl->ParentCatalog = cat;
>
>
>
> The following was suggested, but generates compiler errors:
>
> tbl->Properties->Item[WideString("Jet OLEDB:Create Link")]->Value =
> true;
>
> Error: 'Item' is not a member of 'Adox_tlb::Properties'
>
> Using "Items" and "Property" instead of "Item" generates similar
> errors.
>
>
> The only thing that might fit which the BCB compiler completion
> suggests is:
>
> tbl->Properties->get_Item(tagVARIANT Item, Property **ppvObject);
>
> Unfortunately, I do not know how to supply these arguments, or even if
> this is the correct approach.
>
> I would appreciate any help or suggestions.
>
Technical Details
Message-ID: <400fcfe1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <pu5t00drncdrn41hnftvesb6nviv7pjs4l@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,624e139e318cdbfb
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2004-01-22 05:40:09 PST
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <pu5t00drncdrn41hnftvesb6nviv7pjs4l@4ax.com>
Subject: Re: Linking Tables to an MSAccess Database in Code
Date: Thu, 22 Jan 2004 16:25:42 +0300
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 213.234.218.42
Message-ID: <400fcfe1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1074778081 213.234.218.42 (22 Jan 2004 05:28:01 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail