Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Specifying a Customer Workgroup file in code


Message #1 by Omar Chaudry <OChaudry@b...> on Wed, 23 Oct 2002 16:03:47 +0100
Hi All

How do I specify a custom mdw file when accessing a secure database through
code? I have been playing with the workspace and dbengine objects but can't
find a place to put the path to the workgroup file I want to use.

 

Any help would be much appreciated.

 

Omar

 



  DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.



Message #2 by "Hamilton. Tom" <hamiltont@s...> on Wed, 23 Oct 2002 08:14:53 -0700
Hi Omar - this is what I use under Win9x

SET A97=3D"K:\Apps\access97\office\msaccess.exe"
SET APP=3D"U:\Shortcuts\CMS_App\CMS.mdb"
SET MDW=3D"W:\Production Database\ISU\DHAINV\97Sec.MDW"
%A97% /wrkgrp%MDW% %APP%

Tom Hamilton
T_Systems, Inc
(xxx) xxx-xxxx

 -----Original Message-----
From: 	Omar Chaudry [mailto:OChaudry@b...]
Sent:	Wednesday, October 23, 2002 8:04 AM
To:	Access
Subject:	[access] Specifying a Customer Workgroup file in code

Hi All

How do I specify a custom mdw file when accessing a secure database 
through
code? I have been playing with the workspace and dbengine objects but 
can't
find a place to put the path to the workgroup file I want to use.



Any help would be much appreciated.



Omar





  DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to 
this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or 
any
action or omission taken by you in reliance on it, is prohibited and may 
be
unlawful.  Please immediately contact the sender if you have received 
this
message in error. Thank you.





Message #3 by Omar Chaudry <OChaudry@b...> on Wed, 23 Oct 2002 16:35:12 +0100
Thanks Tom
In fact I am trying to access this db from Excel and run a macro within the
database. The code I'm using in Excel is as follows:-
'------------------ START CODE ------------------------------------
Public Const dbstr = "P:\Test_BOM\bom_test2\Stock 2000.mdb"

Sub tst()
Dim wpace As Workspace
Dim acc As Access.Application
Dim db As Database
Dim mStr As String
On Error GoTo errtrap
Set acc = New Access.Application
Set wpace = acc.DBEngine.Workspaces(0)
Set db = wpace.OpenDatabase(dbstr)
mStr = "xferss"
acc.DoCmd.RunMacro mStr
acc.CloseCurrentDatabase
MsgBox "Data exported successfully"
GoTo endrun

errtrap:
MsgBox Err.Description
GoTo endrun

endrun:
End Sub
'------------------ END CODE --------------------------------------
as you can see I am struggling to put the workgroup file anywhere in the
code. BTW if I put it as part of the dbstr constant it fails.

Thanks again for your help.
Omar

-----Original Message-----
From: Hamilton. Tom [mailto:hamiltont@s...] 
Sent: 23 October 2002 16:15
To: Access
Subject: [access] RE: Specifying a Customer Workgroup file in code

Hi Omar - this is what I use under Win9x

SET A97="K:\Apps\access97\office\msaccess.exe"
SET APP="U:\Shortcuts\CMS_App\CMS.mdb"
SET MDW="W:\Production Database\ISU\DHAINV\97Sec.MDW"
%A97% /wrkgrp%MDW% %APP%

Tom Hamilton
T_Systems, Inc 
(xxx) xxx-xxxx

 -----Original Message-----
From: 	Omar Chaudry [mailto:OChaudry@b...] 
Sent:	Wednesday, October 23, 2002 8:04 AM
To:	Access
Subject:	[access] Specifying a Customer Workgroup file in code

Hi All

How do I specify a custom mdw file when accessing a secure database through
code? I have been playing with the workspace and dbengine objects but can't
find a place to put the path to the workgroup file I want to use.

 

Any help would be much appreciated.

 

Omar

 



  DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.








  DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.


Message #4 by "John Ruff" <papparuff@c...> on Wed, 23 Oct 2002 08:56:46 -0700
Look at the dbengine.systemdb property  

Public Const conWORKGROUP = "P:\Test BOM\bom Test2\MyWorkGroup.mdw"

    DAO.DBEngine.SystemDB = conWORKGROUP



John V. Ruff - The Eternal Optimist :-)
Always Looking For Contract Opportunities

www.noclassroom.com
Live software training
Right over the Internet

Home:  xxx.xxx.xxxx
Cell:  xxx.xxx.xxxx
9306 Farwest Dr SW
Lakewood, WA 98498




-----Original Message-----
From: Omar Chaudry [mailto:OChaudry@b...] 
Sent: Wednesday, October 23, 2002 8:35 AM
To: Access
Subject: [access] RE: Specifying a Customer Workgroup file in code


Thanks Tom
In fact I am trying to access this db from Excel and run a macro within
the database. The code I'm using in Excel is as follows:-
'------------------ START CODE ------------------------------------
Public Const dbstr = "P:\Test_BOM\bom_test2\Stock 2000.mdb"

Sub tst()
Dim wpace As Workspace
Dim acc As Access.Application
Dim db As Database
Dim mStr As String
On Error GoTo errtrap
Set acc = New Access.Application
Set wpace = acc.DBEngine.Workspaces(0)
Set db = wpace.OpenDatabase(dbstr)
mStr = "xferss"
acc.DoCmd.RunMacro mStr
acc.CloseCurrentDatabase
MsgBox "Data exported successfully"
GoTo endrun

errtrap:
MsgBox Err.Description
GoTo endrun

endrun:
End Sub
'------------------ END CODE --------------------------------------
as you can see I am struggling to put the workgroup file anywhere in the
code. BTW if I put it as part of the dbstr constant it fails.

Thanks again for your help.
Omar

-----Original Message-----
From: Hamilton. Tom [mailto:hamiltont@s...] 
Sent: 23 October 2002 16:15
To: Access
Subject: [access] RE: Specifying a Customer Workgroup file in code

Hi Omar - this is what I use under Win9x

SET A97="K:\Apps\access97\office\msaccess.exe"
SET APP="U:\Shortcuts\CMS_App\CMS.mdb"
SET MDW="W:\Production Database\ISU\DHAINV\97Sec.MDW"
%A97% /wrkgrp%MDW% %APP%

Tom Hamilton
T_Systems, Inc 
(xxx) xxx-xxxx

 -----Original Message-----
From: 	Omar Chaudry [mailto:OChaudry@b...] 
Sent:	Wednesday, October 23, 2002 8:04 AM
To:	Access
Subject:	[access] Specifying a Customer Workgroup file in code

Hi All

How do I specify a custom mdw file when accessing a secure database
through code? I have been playing with the workspace and dbengine
objects but can't find a place to put the path to the workgroup file I
want to use.

 

Any help would be much appreciated.

 

Omar

 



  DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to
this message by anyone else is unauthorised.  If you are not the
intended recipient, any disclosure, copying, or distribution of the
message, or any action or omission taken by you in reliance on it, is
prohibited and may be unlawful.  Please immediately contact the sender
if you have received this message in error. Thank you.








  DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to
this message by anyone else is unauthorised.  If you are not the
intended recipient, any disclosure, copying, or distribution of the
message, or any action or omission taken by you in reliance on it, is
prohibited and may be unlawful.  Please immediately contact the sender
if you have received this message in error. Thank you.







  Return to Index