Re: linked tables in Access database
- From: "Jeremy Collins" <jd.collins@xxxxxxxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 08:18:55 +0100
On Wed, 27 Apr 2005 18:50:13 +0100, John Provine <xxx@xxxxxxx> wrote:
Got an Access database that has some ODBC links to Oracle tables. When I
open one of the Oracle tables in my app, I get prompted for the Oracle
password. Obviously, I'm not going to want the users to know that password.
How can I connect my application into Oracle so that I don't see the
password prompt? I've tried a couple of things without success ... using the
"Open" method of the ADO connection object, using the "OpenCurrentDatabase"
method of the Access application object, using the "TransferDatabase" method
of the DoCmd object (which in the ADO docs sounds exactly like what I need).
But none of those do the trick.
Right, I'm just guessing here, but I have to do some futzing with Access linked tables in code.
If you import the ADOX type library, you should have a file called ADOX_TLB. Add this to your uses clause.
Then you can use the ADO Catalog object to manipulate the Access database (rather than the data, if you see what I mean).
For example, I have to change the path of a linked table in an MDB, so I do this:
var
Cat : Catalog;
begin
Cat := coCatalog.Create;
Cat.Set_ActiveConnection(ADOConnection1.ConnectionObject);
Cat.Tables.Item['tb_foo'].Properties['Jet OLEDB:Link Datasource'].Value := Filename;
:
end;
Now, there is also a JET property called "Link Provider String", so I'm guessing
you can do something like this:
with Cat.Tables.Item['tb_foo'] do
Properties['Jet OLEDB:Link Provider String:'].Value := 'ORACLE;PWD=secret';
I'm not sure of the actual connection string, though.
HTH
-- jc .
- References:
- linked tables in Access database
- From: John Provine
- linked tables in Access database
- Prev by Date: Re: Master / detail with TADODataset?
- Next by Date: Re: invalid class typecast
- Previous by thread: linked tables in Access database
- Next by thread: Acces Table, TADOBLOB and WAVE audio
- Index(es):
Relevant Pages
|