dharmesh RAna
February 15th, 2000, 11:05 AM
Hi
I am trying to link the Oracle tables to my Access2000 DAtabase by
using ADO.
I want to append those oracle table links to my Access database.
So for that I have to use ADOx Then I have used following code
*******************************
Function DB_Attach(Attach_Name As Variant, USERID As String, PASSWD As
String, ODBCDATA As String) As Integer
Dim MyDatabase As New ADOX.Catalog
Dim MyTableDef As New Table
On Error GoTo DB_Attach_EXIT
MyDatabase.ActiveConnection = CurrentProject.Connection
MyTableDef.Name = Attach_Name 'PCSADO
Set MyTableDef.ParentCatalog = MyDatabase
MyTableDef.Properties("Jet OLEDB:Cache Link Name/Password") =
True
MyTableDef.Properties("Jet OLEDB:Create Link") = True
MyTableDef.Properties("Jet OLEDB:Link Provider String") =
"ODBC;DSN=" & ODBCDATA & ";DBQ=" & ODBCDATA & ";UID=" & USERID &
";PWD=" & PASSWD
MyTableDef.Properties("Jet OLEDB:Remote Table Name") =
StrConv(USERID, vbUpperCase) & "." & Attach_Name
MyDatabase.Tables.Append MyTableDef
Set MyDatabase = Nothing
Exit Function
*********************************
The first problem is the time required to link the tables is too large compared to DAO
and the 2nd problem is that it is linking those Oracle tables as
READ_ONLY tables so that my queries for updation on those tables don't
work on.
From the ADO help given by MSDN,it is said that you can not update the
Oracle recordsets by using OLE DB Provider.I am using OLEDB provider 4.0
What is the solution for these particular problems .Please help me in the above query.
The same thing ,I could do it in Access 2000 by using DAO objects.
We would like to get the solution related to ADO only.
Regards
I am trying to link the Oracle tables to my Access2000 DAtabase by
using ADO.
I want to append those oracle table links to my Access database.
So for that I have to use ADOx Then I have used following code
*******************************
Function DB_Attach(Attach_Name As Variant, USERID As String, PASSWD As
String, ODBCDATA As String) As Integer
Dim MyDatabase As New ADOX.Catalog
Dim MyTableDef As New Table
On Error GoTo DB_Attach_EXIT
MyDatabase.ActiveConnection = CurrentProject.Connection
MyTableDef.Name = Attach_Name 'PCSADO
Set MyTableDef.ParentCatalog = MyDatabase
MyTableDef.Properties("Jet OLEDB:Cache Link Name/Password") =
True
MyTableDef.Properties("Jet OLEDB:Create Link") = True
MyTableDef.Properties("Jet OLEDB:Link Provider String") =
"ODBC;DSN=" & ODBCDATA & ";DBQ=" & ODBCDATA & ";UID=" & USERID &
";PWD=" & PASSWD
MyTableDef.Properties("Jet OLEDB:Remote Table Name") =
StrConv(USERID, vbUpperCase) & "." & Attach_Name
MyDatabase.Tables.Append MyTableDef
Set MyDatabase = Nothing
Exit Function
*********************************
The first problem is the time required to link the tables is too large compared to DAO
and the 2nd problem is that it is linking those Oracle tables as
READ_ONLY tables so that my queries for updation on those tables don't
work on.
From the ADO help given by MSDN,it is said that you can not update the
Oracle recordsets by using OLE DB Provider.I am using OLEDB provider 4.0
What is the solution for these particular problems .Please help me in the above query.
The same thing ,I could do it in Access 2000 by using DAO objects.
We would like to get the solution related to ADO only.
Regards