Open a Access Dbase File
Open a Access Dbase File
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Open a Access Dbase File

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi all, what I am trying to do is open a dbase file. I have no problem opening a workbook, but how can I change my sub to open a Acces file (labor dbase.mbd)
    I know the workbooks.open is wrong but dont know what to substitute, and can it also open one of the forms within the dbase file at the same time. Thx Dan

    FrmLbedit.Hide
    ChDir "C:Unit PriceDbase"
    Workbooks.Open Filename:="C:Unit PriceDocumentsCharges.xls"

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sorry not trying to open a xls,
    FrmLbedit.Hide
    ChDir "C:\Unit Price\Dbase\"
    Workbooks.Open Filename:="C:\Unit Price\Dbase\Labor Dbase.mbd"
    But The Workbooks.Open Is not correct. Anyont know what it should be ?

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi dantb.
    You might want to go into VBA and familiarize yourself with DAO or ADO.
    DAO is probably good enough for what you are looking for. Is easy to use.
    Look up DAO or Data Access Objects in help.
    Too big a subject to go into here.
    Either that and/or SQL.
    I am weak when it comes to databases but have poked around alittle with DAO.
    Good Luck!
    Tom

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Ok thx Tom, I didnt know that trying to open a dbase file from excel was that intence. I will go and try and learn , thx again for your help, and Have a good evening. Thx again Dan

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I can hyperlink to the dbase (np), but was just trying to put it into vb

  6. #6
    New Member
    Join Date
    Mar 2002
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Dantb,

    First, in XL VBE: Tools, References, and tick checkbox for whichever MS Access Library you need eg "Micosoft Access 9.0 Object Library" if you have Access 2000, then try this..

    Sub OpenAccessDB()

    Dim oApp As New Access.Application
    Dim strDB As String
    Dim stFormName As String

    strDB ="C:\UnitPrice\Dbase\LaborDbase.mbd"
    'I think that was your path, but check !
    stFormName = "**Form Name you want in here**"


    With oApp
    .OpenCurrentDatabase strDB
    .DoCmd.OpenForm stFormName
    .Visible = True
    .UserControl = True
    End With

    End Sub

    (Not really sure if that is what you are after but hope it helps a bit !)


  7. #7
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey Dan.
    Don't be discouraged with DAO.
    Very easy to use. If all you are needing are values from a database, you will have it doing exactly what you want with a minimum amount of code.
    Tom

  8. #8
    New Member
    Join Date
    Mar 2002
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Dan/Tom,

    Oops ! I really didn't want to discourage the use of DAO.It is extremely useful and has methods which ADO doesn't have (yet). It can't open a database or display a form, however, it isn't really meant for that !

    Tom is quite correct in that you could very easily use it to replace the code behind the controls on the form that you want to show, depending on what the form does.

    Sorry, I thought (probably quite wrongly) that you just wanted a shortcut to a data entry form !


  9. #9
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    No Problem sutjh.
    I'm not too sure what Dan is after myself?
    Maybe Dan isn't either?
    Joking Dan!
    Tom

  10. #10
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    I think Tom Hit it on the head, just trying to get the dern dbase to open, then I can add the code to access the form. Thx Tom

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com