Thank you for answering me !
First thing to say about me,... I'm not a programmer !!
But.......After trying both ways DAO & ADO
With password and without password.......
I check manually if the workgroup has changed and it doesn't !!
Tools bars-->tools-->Security-->Workgroup Administrator: DOES NOT
CHANGE !
Stays the same default workgroup: System.mdw
But when I do it manually it works and after changing the workgroup my
DB (data base) close and it opens again automatically, Why the
suggested code does not looks to close the active DB and opens after
this, why simply do not do anything ?
Sorry but I do not understand I send you my tryed code in a command
botton.
Private Sub Command155_Click()
' Using DAO
Dim dbe As PrivDBEngine
Dim wrk As Workspace
Dim dbs As Database
Set dbe = New PrivDBEngine
dbe.SystemDB = "C:\Security.mdw"
dbe.DefaultUser = "Pepe"
Set wrk = dbe.Workspaces(0)
Set dbs = wrk.OpenDatabase("C:\SecurityTablas.mdb")
MsgBox "New Workgroup changed with DAO"
End Sub
'+++++++++++
Private Sub Command154_Click()
'Using ADO
'Microsoft ActiveX Data Objects Library 2.0 ou higher
Dim Cnn As ADODB.Connection
Dim Rst As ADODB.Recordset
Dim strConnect As String
Set Cnn = New ADODB.Connection
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"User Id=Pepe;" & _
"Data Source=C:\SecurityTablas.mdb;" & _
"Persist Security Info=True;" & _
"Jet OLEDB:System Database=C:\Security.mdw"
With Cnn
.CursorLocation = adUseClient
.Open strConnect
End With
Set Rst = New ADODB.Recordset
Rst.ActiveConnection = Cnn
MsgBox "New Workgroup changed with ADO"
End Sub
Please tell me why this codes does not work ??
I feel sorry asking so many times same question.
Regards
Javier
"MacDermott" <ma********@nospam.com> wrote in message news:<mJ*****************@newsread2.news.atl.earth link.net>...
Here's an ADO connection string that works:
Data Source="C:\Program
Files\MyApp\Data\MyDB.mdb";Provider="Microsoft.Jet .OLEDB.4.0";Password =
pwd; User ID = MyID; Jet OLEDB:System database = C:\Program
Files\MyApp\Data\MyApp.mdw
watch for line wrap!
HTH
"Javier Gomez" <ja*****************@gmail.com> wrote in message
news:89**************************@posting.google.c om... Thank you everybody but so far No one sample is working good !
I tryed DAO and ADO both rutines are missing the password in
the routine becuase my Secured MDW has password.
Can you please write the password instruction ??
( I prefer to use DAO)
Regards
Javier Gomez
Trevor Best <no****@besty.org.uk> wrote in message
news:<42**********************@news.zen.co.uk>... Tom van Stiphout wrote:
> On Mon, 07 Mar 2005 03:06:18 GMT, "MacDermott" <ma********@nospam.com>
> wrote:
>
> Or using DAO, you can use code like this:
> Dim dbe As PrivDBEngine
> Dim wrk As Workspace
> Dim dbs As Database
>
> Set dbe = New PrivDBEngine
> dbe.SystemDB = "C:\MyApp\MyWorkgroupFile.mdw"
> dbe.DefaultUser = "SecureUser"
> Set wrk = dbe.Workspaces(0)
> Set dbs = wrk.OpenDatabase("C:\Samples\Secured Northwind.mdb")
>
> It's documented here:
> http://www.microsoft.com/resources/d...t/jetch02.mspx
I may try that next time :-)