Re: Use ADO in Access 2000?

From: Nick Coe \(UK\) (classicnickNOSPAMAT_at_MASPON.yahooDOTcom)
Date: 06/15/04


Date: Tue, 15 Jun 2004 06:16:24 +0100

There are some things you can _only_ do with DAO. ADO has
some very nice and neat ways to do things but overall DAO
still has the edge in terms of overall functionality.
Especially since MS started to deprecate bits like JDO along
with jet, that was a real blow.

Is this what you're after:-

******* Air Code ************

Public Function testadoproc()

  Dim rst As ADODB.Recordset
  Dim cn As ADODB.Connection

  Set cn = CurrentProject.Connection
  Set rst = New ADODB.Recordset
  rst.Open "tblBlog", cn, adOpenKeyset, adLockOptimistic,
adCmdTable

  With rst

    'do stuff

  End With

  rst.Close
  rst = Nothing
  cn = Nothing

End Function

*************************

CurrentProject is part of Application so that full syntax
(in theory) is Application.CurrentProject etc etc.

CodeProject returns the connection to wherever the code
itself is running - use in Library databases etc...

-- 
Nick Coe (UK)
www.alphacos.co.uk
---
"dj" <dj@discussions.microsoft.com> wrote in message
news:3620E8E4-028C-4188-A97E-9A8C593E45FE@microsoft.com...
> I have Full Access rights on the folder the MDB file is
in.
> DAO is still best for Jet dbs?  Is this why I can't find a
single example
> of connecting to the current Access (2000) database using
ADO?
> I thought ADO was the default data access technology for
Access 2000 and up.
> Or is that thought really geared toward using Access as a
front-end for SQL Server?
> In any case, I think I'll take your advice and 'fall back'
to DAO on this one.
>
> Thanks for the input.
> Cheers,
> dj
>
> "Douglas J. Steele" wrote:
>
> > What permissions do you have on the folder in which the
MDB exists? You must
> > have Read, Write and Delete.
> >
> > And why are you trying to avoid DAO? For Jet databases
(i.e.: MDB files),
> > it's still the better way.
> >
> >
> > -- 
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele
> > (no e-mails, please!)
> >
> >
> > "dj" <dj@discussions.microsoft.com> wrote in message
> >
news:0EB7C8B4-7659-4D1B-9A1C-F8E52E93EDCD@microsoft.com...
> > > This seems so simple, yet I can't seem to work it out.
> > > I have an Access 2000 database open.
> > > I want to connect to the database and append to a
table using ADO.
> > > When I try to open the ADO Connection, I get the error
message 'The
> > database has been placed in a state by user 'Admin' on
machine 'MYMACHINE'
> > that prevents it from being opened or locked.'
> > >
> > > I experimented with the Mode settings of the
Connection object to no
> > avail.
> > > I have a reference set to the ADO 2.8 library, no DAO
reference - I'd like
> > to avoid DAO.
> > > Can anyone tell me what I'm missing?
> > >
> > > TIA,
> > > dj
> >
> >
> >


Relevant Pages

  • Re: Knowledge Base Help Not working
    ... Database is a DAO object. ... both Access 2000 and 2002 use ADO. ... Microsoft DAO 3.6 Object Library, ... For example, to ensure that you get a DAO recordset, you'll need to ...
    (microsoft.public.access.formscoding)
  • Re: ADO and the Find method
    ... You cannot compare DAO and ADO. ... database, which has OLEDB provider. ... >>>> Opening of the whole table was not a good design anytime. ...
    (microsoft.public.vb.database.ado)
  • Re: Crosstab query error 3104
    ... Thankfully very few compile errors had to ... I have both DAO & ADO references checked but DAO is higher so it is taking ... Thanks - I inherited the original database & am gradually working through ... then perhaps you've removed the reference to ADO. ...
    (microsoft.public.access.queries)
  • Re: How do I use ADO in VC++ 6.0 to get the columns names of the t
    ... you're using DAO rather than ADO ... (ActiveX Database Objects). ... robust library for working with Jet databases. ...
    (microsoft.public.data.ado)
  • Re: Database variable change from 97 to 2003
    ... Access 2003 has references set to both DAO ... and ADO and, perhaps unfortunately, the ADO reference is set higher in ... use Dim rcd As ADODB.Recordset) ... > modules, however, I get errors on the database variable ...
    (microsoft.public.access.modulesdaovba)