ADOX Linking external tables in VB

ADOX Linking external tables in VB

Post by Paul Clemen » Sat, 05 Oct 2002 06:05:36



I cannot open in exclusive mode since I am sharing the
database on the server.  Using adShareDenyWrite will
prevent the creation of the ldb file if openning the mdb
file directly.

I tried your code with an Access 97 database and I don't receive an error. However, the Mode
property is being ignored for a linked table. It doesn't matter what value I specify, an LDB file is
always created when I open the linked table in Access. This could be because the version of Jet used
in Access 97 (3.51) does not support it directly.

I can look into XP or 2000 if that is what you are using.


Microsoft MVP (Visual Basic)

 
 
 

ADOX Linking external tables in VB

Post by Chris Lei » Sat, 05 Oct 2002 11:21:30


Once I have it figured out I will be linking to Access97
and Access2000 databases and most likely AccessXP in the
future.

>-----Original Message-----
>On Wed, 2 Oct 2002 18:49:04 -0700, "Chris Lein"

> I cannot open in exclusive mode since I am sharing the
> database on the server.  Using adShareDenyWrite will
> prevent the creation of the ldb file if openning the
mdb
> file directly.
>

>I tried your code with an Access 97 database and I don't

receive an error. However, the Mode
Quote:>property is being ignored for a linked table. It doesn't

matter what value I specify, an LDB file is
Quote:>always created when I open the linked table in Access.

This could be because the version of Jet used
>in Access 97 (3.51) does not support it directly.

>I can look into XP or 2000 if that is what you are using.


>Microsoft MVP (Visual Basic)
>.


 
 
 

ADOX Linking external tables in VB

Post by Paul Clemen » Tue, 08 Oct 2002 23:18:24


Once I have it figured out I will be linking to Access97
and Access2000 databases and most likely AccessXP in the
future.

I will take a look at Access 2000/XP but from what I can determine there doesn't appear to be
support for read-only linked tables in Access 97 (Jet 3.51).

The following code worked, without error, for an Access 97 database but the .LDB file is still
created when I open via the linked table:

Dim tbl As New ADOX.Table
Dim cat As New ADOX.Catalog

cat.ActiveConnection = _
   "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=D:\My Documents\db1.mdb;" & _
   "Jet OLEDB:Engine Type=4"

tbl.NAME = "AttachedAccessTable20"
Set tbl.ParentCatalog = cat
tbl.Properties("Jet OLEDB:Remote Table Name") = "NewTable"
tbl.Properties("Jet OLEDB:Link Datasource") = "D:\My Documents\AccessDB.mdb"
tbl.Properties("Jet OLEDB:Link Provider String") = "MS Access;Mode=" & adModeShareDenyWrite

tbl.Properties("Jet OLEDB:Create Link") = True
cat.Tables.Append tbl


Microsoft MVP (Visual Basic)

 
 
 

ADOX Linking external tables in VB

Post by Chris Lei » Sat, 12 Oct 2002 01:36:32


There has to be a way of doing it without the .ldb file
being created on the server.  MS Access can do it without
any problems.
 
 
 

ADOX Linking external tables in VB

Post by Paul Clemen » Sat, 12 Oct 2002 02:18:28


There has to be a way of doing it without the .ldb file
being created on the server.  MS Access can do it without
any problems.

I haven't been able to create and open a linked database table to another Access database without
the .LDB file being created when using  Access 97 (DAO 3.51), unless I specify dbAttachExclusive.


Microsoft MVP (Visual Basic)