Warning
Some notes about the code below:
It doesn't check if the table is already linked first. If it is, you'll get an error you'll have to handle.
The user name and password are passed as clear text, which is a security risk. Someone can open up your database code and get all the info they need to connect to your database and potentially do some harm. If this matters to you, you'll need to either compile your Access database to an MDE and distribute that, or find some way of encrypting/decrypting the connect info on the fly.
Answer
You can use ADOX to link the tables without prompting for user ID and password. First, set a reference to the "Microsoft ADO Ext. 2.8 for DDL and Security" libary (Tools\References... in the VBA editor). If you don't see this entry in the list of available references, browse for "msadox.dll" and add it manually. Your version number may be different, depending on your version of Access (I'm using 2003 here).
You can then use code like this to link to an Oracle table:
Sub LinkOracleTable(Server, UserID, Password, Schema, TableName)
Dim tbl As New ADOX.Table
Dim cat As New ADOX.Catalog
Set cat.ActiveConnection = CurrentProject.Connection
With tbl
.Name = TableName
Set .ParentCatalog = cat
.Properties("Jet OLEDB:Create Link") = True
.Properties("Jet OLEDB:Link Provider String") = "ODBC;" & _
"Driver={Microsoft ODBC For Oracle};" & _
"Server=" & Server & ";" & _
"Uid=" & UserID & ";" & _
"Pwd=" & Password & ";"
.Properties("Jet OLEDB:Cache Link Name/Password") = True
.Properties("Jet OLEDB:Remote Table Name") = Schema & "." & TableName
End With
cat.Tables.Append tbl
cat.ActiveConnection.Close
End Sub
You would call the sub like this:
LinkOracleTable "TNS Service Name", "UserName", "Password", "MySchema", "MyTable"