M
Martin Walke
Hi all,
I have a back-end access database that is accessed from different machines
via ADO/JET4 from VB6. A link to another table in another backend database
gets created during the running of the program. This link can be to
different tables in different databases but the schema of the table is
always the same.
What I currently do is delete the link before adding it to the same (or a
different) table when required. The problem is that i get an error
80040e09(You do not have the necessary permissions to use the 'questions'
object. Have your system administrator or the person who created this object
establish the appropraite permissions for you).
I've tried deleting the link via DAO and get a similar error (3033). I've
googled looking for a solution and most solutions talk about using Access
itself to add the user to the work group.
Two problems there. One, I'm not using workgroups and two, this has to done
programmically as the program is used in different from a number of
different workstations in different locations in the UK.
One solution i've thought about is to not delete the link but update its
linked file reference instead. Is this possible?
The code i use to add the link is:
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=
p:\s12247\studanswers.mdb"
tbl.Name = "questions"
Set tbl.ParentCatalog = cat
tbl.Properties("Jet OLEDB:Create Link") = True
tbl.Properties("Jet OLEDB:Link Datasource") = QFile
tbl.Properties("Jet OLEDB:Remote Table Name") = "Questions"
cat.Tables.Append tbl
Set cat = Nothing
and the code to remove the link is simply
Mydb.Mode = adModeReadWrite
MyDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=
p:\s12247\studanswers.mdb"
MyDB.Execute "drop table questions"
TIA
Martin
I have a back-end access database that is accessed from different machines
via ADO/JET4 from VB6. A link to another table in another backend database
gets created during the running of the program. This link can be to
different tables in different databases but the schema of the table is
always the same.
What I currently do is delete the link before adding it to the same (or a
different) table when required. The problem is that i get an error
80040e09(You do not have the necessary permissions to use the 'questions'
object. Have your system administrator or the person who created this object
establish the appropraite permissions for you).
I've tried deleting the link via DAO and get a similar error (3033). I've
googled looking for a solution and most solutions talk about using Access
itself to add the user to the work group.
Two problems there. One, I'm not using workgroups and two, this has to done
programmically as the program is used in different from a number of
different workstations in different locations in the UK.
One solution i've thought about is to not delete the link but update its
linked file reference instead. Is this possible?
The code i use to add the link is:
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=
p:\s12247\studanswers.mdb"
tbl.Name = "questions"
Set tbl.ParentCatalog = cat
tbl.Properties("Jet OLEDB:Create Link") = True
tbl.Properties("Jet OLEDB:Link Datasource") = QFile
tbl.Properties("Jet OLEDB:Remote Table Name") = "Questions"
cat.Tables.Append tbl
Set cat = Nothing
and the code to remove the link is simply
Mydb.Mode = adModeReadWrite
MyDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=
p:\s12247\studanswers.mdb"
MyDB.Execute "drop table questions"
TIA
Martin