Hi all,
I am trying to do the following with JScript. I want to be able to utilize the workgroup file in an access db. I know you have to utilize the ADOX.Catalog and then set the connection string to the workgroup file and the database that the workgroup file is attached. I this is client side code and the database is on a network share that everyone has mapped so that is not an issue. Any ideas on the code??
Here is a sample of the code I have:
Code:
Sub addUser()
Dim adoCat As ADOX.Catalog
Dim usrNew As ADOX.User
Set adoCat = New ADOX.Catalog
adoCat.ActiveConnection = "Provider='Microsoft.Jet.OLEDB.4.0';" & _
"Data Provider='Z:/Sample.mdb';" & _
"jet oledb:system database='Z:/Sample.mdw'"
With adoCat
.Groups.Append "Something"
Set usrNew = New ADOX.User
usrNew.Name = "someone"
usrNew.ChangePassword "", "Password1"
.Users.Append usrNew
.usrNew.Groups.Append "Something"
End With
Set adoCat.ActiveConnection = Nothing
Set adoCat = Nothing
Set usrNew = Nothing
End Sub
I know the following is VBScript. However when I try to run this code from the click of a button on a web form I get the error that a semi colon is expected on line 2 character 5. If anyone wants I can post the JScript that I have been playing around with and am getting the same error. Any help would be greatly appreciated.
Thanks Chris