L
Lothar Geyer
In a VB-App I open an existing Access db "A" using ADO with an extra
workgroup file. In this file user Admin has no access rights. Then I
create a new database "N" with a database password and copy some tables
from A to N. When I then (in the same app) re-open database N, I connot
read the copied tables.
I assume the reason is that in N only user "Administrator" is defined,
belonging to group "Administratoren" which has no access rights. The
tables in N have no owners, which may be another reason. Group
"Benutzer" has no associated users; but this group has the necessary
access rights to the tables. Also, the connection string uses the
username "Admin", not "Administrator".
I also assume that for opening N or for copying tables from A to N the
definitions in the extra workgroup file from the existing db A are used,
not the default workgroup file system.mdw.
Here is some of my code:
creating database N:
Set tDBU = New ADODB.Connection
With tDBU
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source") = tPfadDB
.Properties("Jet OLEDBatabase Password") = dbpw
End With
ConnStr = tDBU.ConnectionString
Set tDBU = Nothing
Set tCAT = New ADOX.Catalog
tCAT.create ConnStr
Set tDBU = tCAT.ActiveConnection
tDBU.Close
Set tCAT = Nothing
copying tables:
sql = "Select * Into Umfragen" _
& " In '' ';database=" & tPfadDB & ";PWD=" & dbpw & "'" _
& " From Umfragen"
mCNN.Execute sql
I try to reopen the new database with
Set tDBU = New ADODB.Connection
With tDBU
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source") = tPfadDB
.Properties("Jet OLEDBatabase Password") = dbpw
.Open
End With
this is the connection string for this open:
Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data
Source=F:\Umfragen\Update20050731.mdb;Mode=Share Deny None;Extended
Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry
Path="";Jet OLEDBatabase Password=DASPASSWORT;Jet OLEDB:Engine
Type=5;Jet OLEDBatabase Locking Mode=1;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False
What is my _real_ problem? And how to solve it?
Lothar Geyer
workgroup file. In this file user Admin has no access rights. Then I
create a new database "N" with a database password and copy some tables
from A to N. When I then (in the same app) re-open database N, I connot
read the copied tables.
I assume the reason is that in N only user "Administrator" is defined,
belonging to group "Administratoren" which has no access rights. The
tables in N have no owners, which may be another reason. Group
"Benutzer" has no associated users; but this group has the necessary
access rights to the tables. Also, the connection string uses the
username "Admin", not "Administrator".
I also assume that for opening N or for copying tables from A to N the
definitions in the extra workgroup file from the existing db A are used,
not the default workgroup file system.mdw.
Here is some of my code:
creating database N:
Set tDBU = New ADODB.Connection
With tDBU
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source") = tPfadDB
.Properties("Jet OLEDBatabase Password") = dbpw
End With
ConnStr = tDBU.ConnectionString
Set tDBU = Nothing
Set tCAT = New ADOX.Catalog
tCAT.create ConnStr
Set tDBU = tCAT.ActiveConnection
tDBU.Close
Set tCAT = Nothing
copying tables:
sql = "Select * Into Umfragen" _
& " In '' ';database=" & tPfadDB & ";PWD=" & dbpw & "'" _
& " From Umfragen"
mCNN.Execute sql
I try to reopen the new database with
Set tDBU = New ADODB.Connection
With tDBU
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source") = tPfadDB
.Properties("Jet OLEDBatabase Password") = dbpw
.Open
End With
this is the connection string for this open:
Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data
Source=F:\Umfragen\Update20050731.mdb;Mode=Share Deny None;Extended
Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry
Path="";Jet OLEDBatabase Password=DASPASSWORT;Jet OLEDB:Engine
Type=5;Jet OLEDBatabase Locking Mode=1;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False
What is my _real_ problem? And how to solve it?
Lothar Geyer