473,418 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Transfer Tables with User Level Security

What is the fastest way to transfer a table from an Access database with user level security to another Access database with user level security. The two databases have different workgroups.
Aug 28 '07 #1
3 2411
ADezii
8,834 Expert 8TB
What is the fastest way to transfer a table from an Access database with user level security to another Access database with user level security. The two databases have different workgroups.
I imagine that this would be a difficult challenge. The only method I can think of is to create an ADO Connection to the other Database, specifiy the nesessary Parameters such as: Password, UserID, and System Database within the Connection, then physically Append the Records to an existing Table. This is the only thing that comes to mind right now, but I'm sure there are other alternatives. Be patient and let's see.
Aug 29 '07 #2
Thanks for helping! I can be patient.

ADO works but it takes a long time. I have 2 tables in one database that are transfered to 8 different databases. When the databases were unsecured the docmd.transferdatabase method was used and took only a few minutes. The ADO process takes more than 30 minutes.
Aug 29 '07 #3
aresuy
1
Hi ninjasix8,
I had the same problem and resolved it yesterday as follows. Hope it works for you. Jose from Uruguay.

Problem: Linking or importing files resident in user-level protected databases.

Example:

Database A:
Path-Name: C:\ProjectA\ApplicationA.mdb
User: Boy
Password: ball
Security file: C:\ProjectSecurity\Sec_AppA.mdw
Shortcut: "C:\Program Files\MsAccess.exe " "C:\ProjectA\ApplicationA.mdw" /WRKGRP

"C:\ProjectSecurity\Sec_AppA.mdw"

Database B (assumed as protected, but may be unprotected or only protected at general level):
Path-Name: C:\ProjectB\ApplicationB.mdb
User: Girl
Password: doll
Security file: C:\ProjectSecurity\Sec_AppB.mdw
Shortcut: "C:\Program Files\MsAccess.exe " "C:\ProjectB\ApplicationB.mdw" /WRKGRP

"C:\ProjectSecurity\Sec_AppB.mdw"

Goal: Link or import Table_X and Table_Y from ApplicationA.mdb to ApplicationB.mdb

1) Open ApplicationA and create user Girl with, at least, design permissions.

2) Insert in main module of ApplicationB.mdb:

Dim returnVar as Variant, strT as String, strS as String, strU as String
Public strB as String

strT = "Table_X"
strS = "C:\ProjectA\ApplicationA.mdb"
strU = "Boy" 'see footnote 1
strB = "Girl" 'see footnote 1

returnVar = fetchTable(strT, strS, strU) 'shorter than fetchTable("Table_X",_
' "C:\ProjectA\ApplicationA.mdb","Boy")
strT = "Table_Y"
returnVar = fetchTable(strT, strS, strU)

3) Create function fetchTable:

Function fetchTable(strTable As String, strSource As String, strUser As String)

Dim db As Database
Dim con As Container
Dim doc As Document
Dim wrksp As Workspace

Set wrksp = DBEngine.Workspaces(0)
Set db = CurrentDb()

'------------'next six lines only needed if Girl
'has not full permissions in ApplicationB

'Set con = db.Containers("Tables")
'con.UserName = strB
'con.Permissions = dbSecFullAccess
'Set doc = con.Documents(strTable)
'doc.UserName = strB
'doc.Permissions = dbSecFullAccess

'------------'next three lines only for imported tables
'and if suitable to your particular purposes

On Error Resume Next
db.TableDefs.Delete strTable
On Error GoTo 0

'----------- 'only if Workgroups for front and back-tables are
'different (our case)

Dim strPWD As String
Dim strSecFile As String
Dim dbe As PrivDBEngine

strPwd = "ball" 'correlated with strU/strUser; see footnote 1

strSecFile = "C:\ProjectSecurity\Sec_AppA.mdw"

Set dbe = New PrivDBEngine
dbe.SystemDB = strSecFile
dbe.DefaultUser = strUser
dbe.DefaultPassword = strPWD
Set wrksp = dbe.Workspaces(0)
Set db = wrksp.OpenDatabase(strSource) 'does not truly open database
'but makes it available

'-----------'next line only if workgroup is the same (not our case)
'Set db = wrksp.OpenDatabase(strSource)

Set con = db.Containers("Databases")
Set doc = con.Documents("MSysdb")
doc.UserName = "Users"
doc.Permissions = dbSecDBOpen 'do not use this line if using the same
' user; see footnote 1
Set con = db.Containers("Tables")
Set doc = con.Documents(strTable)
doc.UserName = strUser
doc.Permissions = dbSecReadDef 'do not use this line if using the same
'user; see footnote 1

'-----------'next line: choose if you want to link or import

DoCmd.TransferDatabase [acLink]/[acImport], "Microsoft Access", strSource,_
acTable, strTable, strTable

Set db = CurrentDb()

End Function

Footnotes:
(1) You may opt for passing "Boy" as parameter (with full access to
ApplicationA) or "Girl" (with partial permissions). Both will work. This can be
important if you are reluctant to write down one of the user-password couples
onto code. But, if you choose to pass ApplicationB's user ("Girl") then notice:
strU = "Girl" ; strB = strU ; strPWD = "doll" and you must cancel
'doc.Permissions' lines

(2) If ApplicationB is not protected at user level, you may save some
unnecesary instructions.
Of course, the only available parameters to pass are "Boy" and "ball".

(3) This solution was designed after testing and adjusting examples provided by
reading Sections 13, 14 & 46 of an article from Mary Chipman et all. that you
may found at:
http://support.microsoft.com/default.aspx?scid=%2Fsupport%2Faccess%2Fcontent%2F secfaq.asp
Oct 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Brad H McCollum | last post by:
I'm writing an application using VB 6.0 as the front-end GUI, and the MSDE version of SQL Server as the back-end (it's a program for a really small # of users --- less then 3-4). I'm trying to...
5
by: Ahmed | last post by:
I'm trying to find a way to prevent users from editing the contents of tables within my MS Access 2000 database. I want them to be able to create queries, but not alter the data. I thought about...
3
by: patcho | last post by:
Hello, I have a problem that I was hoping to get some assistance with. I have built a split database (back end with all the tables and a password to protect the information & a front end to link...
1
by: Smriti Dev | last post by:
Hi There, I am designing a database and want to give privileges to a type of user so they only view some fields of a table when they are a certain type in a database. They should be able to...
5
by: Tom | last post by:
Hi I am trying to transfer to a different .ASPX page using Server.Transfer. However, I get the following error: "Error executing child request for .aspx." Anyone know why? Thanks for...
3
by: paul reed | last post by:
Hi , I have a few folders within my root directory on my web server where different app components live. One folder, "Reports", is where all the ASPX pages live that have reports embedded in...
5
by: aure_bobo | last post by:
Hi all, I'm currently developing a system with several webapps in ASP.NET/C#. One of my website is used to login user : I will call this website Webapp1. Depending on the user attributes, I...
7
by: cefrancke | last post by:
I have a few tables with sensitive user information (passwords, etc.) and I would like to prevent someone from opening a blank database and importing those tables. Is there a way to "hide" or...
4
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.