Why are you using ADOX, which I understand to be buggy and unreliable?
--
Joan Wild
Microsoft Access MVP
"Webtree" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Fri, 11 Jul 2003 15:32:38 +0100, Webtree
> <(E-Mail Removed)> wrote:
>
> >Update, valid credentials for the MDW fail, as do admin and blank...
> >
> >AAAAAAAAAARGH
> >
> >On Fri, 11 Jul 2003 15:30:37 +0100, Webtree
> ><(E-Mail Removed)> wrote:
> >
> >>Hi, I have now managed to get past the error,not sure how, but I'm
> >>creating an user, and adding them using the code below.
> >>
> >>Please whats wrong with this code It crashes on Create the Database
> >>File, (adocat.create) with Not a valid Account Name or Password
> >>
> >>I tried to set admin priviledges on the DB to the user, but couldn't
> >>figure out how to use SetPermissions for the DB object.
> >>
> >>Public Function testado()
> >>
> >>
> >>Dim adoCat As ADOX.Catalog
> >>Dim adoCurCat As ADOX.Catalog
> >>Dim tbl1 As ADOX.Table
> >>
> >>Dim strName As String
> >>
> >>Dim usr1 As ADOX.User
> >>Dim grp1 As ADOX.Group
> >>
> >>Dim strUser As String
> >>Dim strPassword As String
> >>Dim strPID As String
> >>
> >>strUser = "TransferUserABC123"
> >>strPassword = "TUA1"
> >>strPID = "qwertyuiop"
> >>
> >>strName = "c:\fred_" & Format(Time, "hh_mm_ss") & ".mdb"
> >>
> >>Set adoCat = New ADOX.Catalog
> >>Set adoCurCat = New ADOX.Catalog
> >>
> >>adoCurCat.ActiveConnection = CurrentProject.Connection
> >>
> >>Set usr1 = New ADOX.User
> >>Set grp1 = adoCurCat.Groups("botAccess")
> >>
> >>usr1.Name = strUser
> >>
> >>'usr1.Properties("PID") = strPID
> >>'usr1.ChangePassword "", strPassword
> >>
> >>adoCurCat.Users.Append strUser ', strPassword
> >>
> >>'usr1.ChangePassword "", strPassword
> >>
> >>adoCurCat.Groups("botAccess").Users.Append usr1.Name
> >>'usr1.Groups.Append "botAccess"
> >>
> >>
> >>For Each tbl1 In adoCurCat.Tables
> >> adoCurCat.Users(strUser).SetPermissions tbl1.Name, adPermObjTable,
> >>adAccessSet, adRightFull
> >>Next
> >>
> >>'Create the database file
> >>adoCat.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> >> "Database='" & strName & "';" & _
> >> "Usr=" & strUser & ";Pwd=" & "" & ";" & _
> >> "Jet OLEDB:System
> >>database=d:\mydocu~1\hawthorne\botmdw.mdw;"
> >>
> >>adoCurCat.Users.Delete strUser
> >>
> >>
> >>End Function
> >>
> >>
> >>
> >>On Fri, 11 Jul 2003 15:06:13 +0100, Webtree
> >><(E-Mail Removed)> wrote:
> >>
> >>>HELP..................... I'm tearing my hair out
> >>>
> >>>I need to create an MDB file in access2000 using ADOX to use a given
> >>>MDW file. I have tried
> >>>
> >>>adoCat.create "provider=microsoft.jet.oledb.4.0;DAta
> >>>Source='c:\bob.mdb'"
> >>>
> >>>which works
> >>>
> >>>If I append ";jet oledb:System Database=pathtoMDWfile;usr=x;pwd=y"
> >>>
> >>>I am getting "Could not find installable ISAM"
> >>>
> >>>Any fix or alternative code to create an Access DB using an MDW file
> >>>via ADOX will be greatly appreciated.
> >>>
> >>>Any Ideas?
>
|