Home All Groups Group Topic Archive Search About

dao technique to add column to table in remote ULS db..

Author
22 Oct 2007 6:53 PM
nycdon
Can I (and if so, how?) pass id/password thru vba/dao so can add column to
Table in remote User level secured Back end database? (access 2000)?..

thanx!
don

Author
30 Oct 2007 8:05 PM
Wolfgang Kais
Hello "nycdon".

"nycdon" wrote:
> Can I (and if so, how?) pass id/password thru vba/dao so can add
> column to Table in remote User level secured Back end database?
> (access 2000)?..

If the backend database belongt to the frontend database that you
use, this should not be neccessary. To open another database:
Set wsp = DBengine.Workspaces(0)
Set dbs = wsp.OpenDatabase(...)

To use the same workgroup file but another user, don't use the
default workspace but create a new one:
Set wsp = DBEngine.CreateWorkspace("SecondWorkspace", "OtherUser", _
    "OtherUsersPassword", dbUseJet)
Set dbs = wsp.OpenDatabase(...)

You cannot create a workspace as a user from another workgoup, since
the SystemDB property of the DBEngine object must be set before any
workspace is created. By opening a database in the UI of Access you
already create a workspace ("#Default Workspace#").

After opening the database you sould store a referenc to the TableDef
object of the desired table and add a new column to the table:

    With dbs
        With .TableDefs("Artikel")
            .Fields.Append .CreateField("NewField", dbText, 50)
        End With
    End With

--
Regards,
Wolfgang

Bookmark and Share