Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $95

Dim DAO.Database - problem

Discussion in 'Information Technology' started by Rolf Rosenquist, Jul 28, 2006.

  1. Rolf Rosenquist

    Rolf Rosenquist
    Expand Collapse
    Guest

    I have got an Access program that works in my computer. Some part of its
    code should be used in one of my own programs, so I copied and pasted those
    lines of code. But I get the error that the type is not defined. The line
    that doesn't work is: 'Dim db As DAO.Database'

    When in the sample program, I can define a second dim and get the DAO as
    well as Database from the combo, but these two aren't there when I write the
    code in my own program. Where and how should I define those two forst?

    / Rolf
     
  2. Loading...


  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    In the code window, choose References from the Tools menu.
    Check the box beside:
    Microsoft DAO 3.6 Library.

    All versions of Access have this library selected by default except Access
    2000 and 2002.

    More info:
    http://allenbrowne.com/ser-38.html

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Rolf Rosenquist" <rolf@nomail.com> wrote in message
    news:Ob4Qg%23krGHA.1604@TK2MSFTNGP05.phx.gbl...
    >I have got an Access program that works in my computer. Some part of its
    > code should be used in one of my own programs, so I copied and pasted
    > those
    > lines of code. But I get the error that the type is not defined. The line
    > that doesn't work is: 'Dim db As DAO.Database'
    >
    > When in the sample program, I can define a second dim and get the DAO as
    > well as Database from the combo, but these two aren't there when I write
    > the
    > code in my own program. Where and how should I define those two forst?
    >
    > / Rolf
     
  4. RoyVidar

    RoyVidar
    Expand Collapse
    Guest

    "Rolf Rosenquist" <rolf@nomail.com> wrote in message
    <Ob4Qg#krGHA.1604@TK2MSFTNGP05.phx.gbl>:
    > I have got an Access program that works in my computer. Some part of
    > its code should be used in one of my own programs, so I copied and
    > pasted those lines of code. But I get the error that the type is not
    > defined. The line that doesn't work is: 'Dim db As DAO.Database'
    >
    > When in the sample program, I can define a second dim and get the DAO
    > as well as Database from the combo, but these two aren't there when I
    > write the code in my own program. Where and how should I define those
    > two forst?
    >
    > / Rolf


    Ensure you have a reference to Microsoft DAO 3.6 Object Library (in VBE
    - Tools | References)

    --
    Roy-Vidar
     
  5. Rolf Rosenquist

    Rolf Rosenquist
    Expand Collapse
    Guest

    Thank you both Allen and Roy for your support! Now it works.
    / Rolf
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page