Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2004, 06:02 PM
Authorized User
 
Join Date: Mar 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dim dbs As Database

I am not sure why this is happening.
When I typed in the lines below, I wasn't given the option of Database after the As sentax. Now I am getting a Compile Error, User-Defined Type not Defined.

Any Idea why?

Private Sub cmdAdd_Click()

        Dim dbs As Database, rst As Recordset

 
Old May 6th, 2004, 07:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It depends on what references you have, for example ADO or DAO.
Acc97 comes with DAO as default
Acc2k comes with ADO as default

So make sure you've got your references in order

If you're using DAO, try
Dim dbs as DAO.Database

If you're using ADO, try
Dim dbs as ADODB.Database

HTH

Steven

I am a loud man with a very large hat. This means I am in charge





Similar Threads
Thread Thread Starter Forum Replies Last Post
The origin of the "DIM" keyword RGCook BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 9 February 6th, 2009 09:03 AM
What does (Me!) and (Dim)stand for in VBA Coding? srswedeen Access VBA 1 October 14th, 2005 06:41 AM
Can't DIM database object egolsen Access VBA 2 September 26th, 2005 04:25 PM
Dim Types in ASP? rmwalters2000 Classic ASP Basics 2 August 11th, 2004 12:28 AM
Dim in VB.NET khautinh VB.NET 2002/2003 Basics 2 August 3rd, 2003 09:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.