Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Thanked 0 Times in 0 Posts

    delete field in a remote database (Access 2000)

    delete field in a remote database

    Can i delete a field in a remote database? I have tried to build the code but i couldnt continie it.I have done the following:

    Dim wsp As DAO.Workspace
    Dim dbs As DAO.Database
    Dim tdf As DAO.TableDef
    Dim fld As DAO.Field
    Set wsp = DAO.DBEngine.Workspaces(0)
    Set dbs = wsp.OpenDatabase("C:BEstoreBE.mdb")
    Set tdf = dbs.TableDefs("Products")

    There is field in the table products called "Discount" and i want to delete it. Is it possible?

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Toronto, Ontario, Canada
    Thanked 0 Times in 0 Posts

    Re: delete field in a remote database (Access 2000)


    continue on like this:

    fld = tdf.Fields("Discount")
    tdf.Fields.Delete fld.Name

    That should do it for you.
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts