Article View: borland.public.cppbuilder.database.ado
Article #1998Re: MS Access Linked Tables
From: Viatcheslav V. Vassiliev
Date: Tue, 09 Dec 2003 15:25
Date: Tue, 09 Dec 2003 15:25
51 lines
2856 bytes
2856 bytes
You should use ADOX - import its type library or use Variant object. This
code is in JScript but you should have no problems to convert it in BCB.
Linked tables may not be visible in designer but you can set TableName
property at runtime.
//-------------------------------------------
var connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_test.mdb";
var cat = new ActiveXObject("ADOX.Catalog");
cat.Create(connStr);
var tbl = new ActiveXObject("ADOX.Table");
tbl.ParentCatalog = cat;
tbl.Name = "DstTable";
tbl.Properties.Item("Jet OLEDB:Create Link").Value = true;
tbl.Properties.Item("Jet OLEDB:Link Datasource").Value =
"C:\\Temp\\SrcDB.mdb";
tbl.Properties.Item("Jet OLEDB:Remote Table Name").Value = "SrcTable";
cat.Tables.Append(tbl);
cat = null;
//------------------------------------------
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:dklbtv08t10eh699aqct3ihjm6r2l58qd1@4ax.com...
> I'm using a TADOConnection component which connects to a Microsoft
> Access Database which has a linked table. I can use the linked table
> in queries by designating it in TADOQuery.SQL, but the linked table
> does not appear on as a choice on TADOTable.Name.
>
> Can a linked table in an MS Access database be connected to a
> TADOTable?
>
> I have a short program in MS Access which re-links under certain
> conditions if the database is moved to a different folder. It uses
> the following MS Access property and method
>
> myTable.Connect = ";DATABASE=" & dataPath
> myTable.RefreshLink()
>
> Are similar properties available in TADO components?
>
Technical Details
Message-ID:
<3fd60fbf$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<dklbtv08t10eh699aqct3ihjm6r2l58qd1@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,3d60f5d5e721138 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-12-09 10:39:57 PST From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <dklbtv08t10eh699aqct3ihjm6r2l58qd1@4ax.com> Subject: Re: MS Access Linked Tables Date: Tue, 9 Dec 2003 18:25:40 +0300 Lines: 53 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: <3fd60fbf$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1070993343 213.234.218.42 (9 Dec 2003 10:09:03 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail