Problem creating database

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 OLEDB:Database 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 OLEDB:Database 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 OLEDB:Database Password=DASPASSWORT;Jet OLEDB:Engine
Type=5;Jet OLEDB:Database 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 OLEDB:Don'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
 
T

TC

I don't know ADO, so most of that went over my head. However, you do
say: "The tables in N have no owners". In the scenario that you
describe, this means that the tables in N were created by a user or
users, who /do not exist/ in the workgroup file that was in use when
you tried to determine their owners.

In this context, "user" means "unique combination of username and
Personal Identifier (PID)".

Does that help?

TC
 
L

Lothar Geyer

Hi TC,
I don't know ADO, so most of that went over my head. However, you do
say: "The tables in N have no owners". In the scenario that you
describe, this means that the tables in N were created by a user or
users, who /do not exist/ in the workgroup file that was in use when
you tried to determine their owners.

But I think with a database protected by a database password (not a
workgroup file) I do not need any any user accounting information. Or am
I wrong?

Lothar Geyer
 
T

TC

Ah, I missed that you are using VB (not Access/VBA). I've never really
known how VB deals with workgroup files. My understanding of how
workgroup files are used with Access & Jet, might not translate
correctly, to VB.

Maybe someone else can help?

Cheers,
TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top