|
-
Jul 17th, 2001, 08:36 AM
#1
Thread Starter
Junior Member
Simple Declaration Question
I was wondering what the correct variable type would be within the declarations section for the following variables:
************
Set DB = DBEngine.Workspaces(0).Databases(0)
***********
Set Table = DB.openrecordset("Registered Students Table", DB_OPEN_DYNASET)
************
I'm pretty sure the "Table" variable is Dim Table as Recordset but what is the "DB" variable??? Is it Dim DB as Connection????
-
Jul 17th, 2001, 08:42 AM
#2
Fanatic Member
Dim db as database
This is DAO...
-
Jul 17th, 2001, 09:38 AM
#3
Thread Starter
Junior Member
I know that what you are saying should work but for some reason it does not......I keep getting a "User defined type not defined" error when "On_Current" and "On_Load"........I really don't understand what the problem is, it should be exactly what you said.........It works fine if I leave both variables as "Variant" but of course that is bad programming. Thanks for all your help
-
Jul 17th, 2001, 10:51 AM
#4
Black Cat
Make sure your reference is set to DAO, and there's not one set for ADO.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jul 17th, 2001, 11:45 AM
#5
Thread Starter
Junior Member
Thanks for all your help....It works now........I added the reference to MS DAO 3.6 Object Library and removed the reference to MS ActiveX Data Objects 2.1 Library.......I am assuming this is correct now that it is working. If it is still wrong please let me know. Thanks again!
-
Jul 17th, 2001, 12:54 PM
#6
Black Cat
You doing this with Access 2000 / VBA? I believe it defaults to having the reference for ADO checked, which can cause confusion if you add DAO, because of similar object names. Since you have it working you should be all set.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|