type database doesn't exist?

M

Matthaeus

Hi,

I've got problems in declaring a variable in Access 2002
(part of Office XP) as "Database"

There is plenty of sample code in the help with Database
as type but it produces a compiler-error (and also it
doesn't appear in the choice for the types).
I also have problems in assigning an actual object to
objects of the type "Recordset, Table, AccessObject"
It always says: type mismatch although I'm pretty sure,
that the types are allright. Code-sample:

Dim Imported As Table
Set Imported = Outlook.Tabledefs("Contacts_Import")

.....where Outlook is of the type object (since database
isn't accepted from the compiler) and has a database
assigned to it.

Another example is:

Dim Datensatz_Orig As Recordset
Set Datensatz_Orig = Outlook.OpenRecordset("Contacts")

.....Contacts and Contacts_Import are two tables in that
database

Any help is greatly appreciated.
Matthaeus
 
M

Matthaeus

Hi everyone,

the problem is almost solved (only a small one remaining).
So you don't need to answer anymore.

Have a nice day,
Matthaeus
 
D

Douglas J. Steele

I'm sure I already answered this for you in another newsgroup today...

Database is a DAO object. By default, Access 2002 uses ADO.

With any code module open, select Tools | References from the menu bar,
scroll through the list of available references until you find the one for
Microsoft DAO 3.6 Object Library, and select it. If you're not going to be
using ADO, uncheck the reference to Microsoft ActiveX Data Objects 2.5
Library

If you have both references, you'll find that you'll need to "disambiguate"
certain declarations, because objects with the same names exist in the 2
models. For example, to ensure that you get a DAO recordset, you'll need to
use Dim rsCurr as DAO.Recordset (to guarantee an ADO recordset, you'd use
Dim rsCurr As ADODB.Recordset)

The list of objects with the same names in the 2 models is Connection,
Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
and Recordset
 
M

Matthaeus

Yes you did. Sorry for that, posted this question before
your answer. Thanks anyway,
Matthaeus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top