Help Me! <re-posted from yesterday>

C

chad

One of the this that doesn't work is the following simple
piece of code:

Set r = CurrentDb.OpenRecordset("SELECT DISTINCT Year
([DateOut]) AS Yr FROM tblAbsences ORDER BY Year
([DateOut]) DESC;")

The error that is generated is "Type mismatch" (Error code
13). It works fine in a database that was converted from
97 to 2000, but when I put this piece of code in a
database that was newly created, it flops.

Wayne: I know what you mean about having to specifiy DAO
or ADO before the Recordset, but I don't even get
IntelliSense after typing DAO.


-----Original Message-----
What functionality appears to be missing?

By default, Access 2000 uses ADO instead of DAO. You may
need to set a reference for DAO.
Also, when you DIM an object, such as a recordset,
specify which of the two it is.
 
R

RobFMS

Chat

He may have meant for you to go to Tools->References and select DAO 3.6 from
the listing.
You can get to the menu by opening up your code.

HTH

--

Rob

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Problems with your database? Need to upgrade your application?
Contact the FMS Professional Solutions Group: www.fmsinc.com/consulting

Need a Book Recommendation?
www.fmsinc.com/toplevel/books.htm

Need software tools for Access, VB or .NET?
http://www.fmsinc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



chad said:
One of the this that doesn't work is the following simple
piece of code:

Set r = CurrentDb.OpenRecordset("SELECT DISTINCT Year
([DateOut]) AS Yr FROM tblAbsences ORDER BY Year
([DateOut]) DESC;")

The error that is generated is "Type mismatch" (Error code
13). It works fine in a database that was converted from
97 to 2000, but when I put this piece of code in a
database that was newly created, it flops.

Wayne: I know what you mean about having to specifiy DAO
or ADO before the Recordset, but I don't even get
IntelliSense after typing DAO.


-----Original Message-----
What functionality appears to be missing?

By default, Access 2000 uses ADO instead of DAO. You may
need to set a reference for DAO.
Also, when you DIM an object, such as a recordset,
specify which of the two it is.
 
C

chad

Thanks for your reply Rob.

I looked at a database that is in good working order,
opened up a code window and went to Tools-->References and
noted which boxes were checked. I then went to my newly
created database and checked all of the same boxes. No
luck. I still get an error.

Any more help would be appreciated.
-----Original Message-----
Chat

He may have meant for you to go to Tools->References and select DAO 3.6 from
the listing.
You can get to the menu by opening up your code.

HTH

--

Rob

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Problems with your database? Need to upgrade your application?
Contact the FMS Professional Solutions Group: www.fmsinc.com/consulting

Need a Book Recommendation?
www.fmsinc.com/toplevel/books.htm

Need software tools for Access, VB or .NET?
http://www.fmsinc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



chad said:
One of the this that doesn't work is the following simple
piece of code:

Set r = CurrentDb.OpenRecordset("SELECT DISTINCT Year
([DateOut]) AS Yr FROM tblAbsences ORDER BY Year
([DateOut]) DESC;")

The error that is generated is "Type mismatch" (Error code
13). It works fine in a database that was converted from
97 to 2000, but when I put this piece of code in a
database that was newly created, it flops.

Wayne: I know what you mean about having to specifiy DAO
or ADO before the Recordset, but I don't even get
IntelliSense after typing DAO.


-----Original Message-----
What functionality appears to be missing?

By default, Access 2000 uses ADO instead of DAO. You
may
need to set a reference for DAO.
Also, when you DIM an object, such as a recordset,
specify which of the two it is.
Example:
Dim rst As DAO.Recordset

--
Wayne Morgan
Microsoft Access MVP


When we upgraded from Access 97 to 2000, it seems,
when
I
create a new database, some of the built-in functionality
of Access is not available. I can copy an old database
(one that was converted from 97 to 2000) and the
functionality is there. Are there references I
should
set
or do we all have a bum load of Access?


.
 
C

chad

Thanks for your reply Frits.

I did set the reference to Microsoft DAO 3.6 Object
Library with no luck.
 
F

Frits van Soldt

chad said:
Thanks for your reply Frits.

I did set the reference to Microsoft DAO 3.6 Object
Library with no luck.
Since you don't get intellisense after typing dim rs as DAO., there might be
a problem with the registration of the DAO library. Press F2 to bring up the
object browser and check if DAO is listed there. In the references, remove
any
references to the activex data object library.
Maybe re-registering the DAO library will also help.(in C:\Program
Files\Common Files\Microsoft Shared\DAO\dao360.dll)
 

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

Similar Threads


Top