473,473 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Compile error (info type not defined)

I'm trying to use the code below. But when the code is run I get:
Compile error: an infotype defined by user is not defined. <dbClient As
Databaseis then highlighted.
Somebody an idea on how do I make this work?
Thanks,
john
Private Sub CheckExists(strTableName As String)
' check to see if the table exists, if it does then delete it since the next
step
' in the process is to run a MakeTable query

Dim dbClient As Database
Dim tdf As TableDef
Set dbClient = CurrentDb

For Each tdf In dbClient.TableDefs
If tdf.Name = strTableName Then
DoCmd.DeleteObject acTable, trTableName
Exit Sub
End If
Next

End Sub

The method is called by:
Private Sub CheckExists("MyTable")
Sep 24 '06 #1
2 1619
"john" <jo**@test.comwrote in message
<Md******************************@casema.nl>:
I'm trying to use the code below. But when the code is run I get:
Compile error: an infotype defined by user is not defined. <dbClient
As Databaseis then highlighted.
Somebody an idea on how do I make this work?
Thanks,
john
Private Sub CheckExists(strTableName As String)
' check to see if the table exists, if it does then delete it since
the next step
' in the process is to run a MakeTable query

Dim dbClient As Database
Dim tdf As TableDef
Set dbClient = CurrentDb

For Each tdf In dbClient.TableDefs
If tdf.Name = strTableName Then
DoCmd.DeleteObject acTable, trTableName
Exit Sub
End If
Next

End Sub

The method is called by:
Private Sub CheckExists("MyTable")
Try setting a reference to Microsoft DAO 3.6 Object Library (in
VBE - Tools | References)

Also, I'd recommend disambiguating your declarations.

Dim dbClient As DAO.Database
Dim tdf As DAO.TableDef

Some of the DAO objects, properties and methods, share the same
*name* as objects, properties and methods of other libraries (ADO),
but they are different, which will/may give RT 13 Type Mismatch
later on.

--
Roy-Vidar
Sep 24 '06 #2
"RoyVidar" <ro*************@yahoo.noschreef in bericht
>Private Sub CheckExists("MyTable")

Try setting a reference to Microsoft DAO 3.6 Object Library (in
VBE - Tools | References)

Also, I'd recommend disambiguating your declarations.

Dim dbClient As DAO.Database
Dim tdf As DAO.TableDef

Some of the DAO objects, properties and methods, share the same
*name* as objects, properties and methods of other libraries (ADO),
but they are different, which will/may give RT 13 Type Mismatch
later on.
I did set the DAO reference in another mdb and I thought it was an overall
Access setting. Now I see, it isn't. Setting the reference did the trick!
Thanks,
john
Sep 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Brian | last post by:
Greetings: I am trying to compile the following code via command line. It compiles just fine in visual studio 2002 v7 so i took looked at the properties and i got the following command line...
5
by: Brice Prunier | last post by:
Here under 4 schemas i'm working with ( it may be long: sorry...) The context is the following : Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema: no TargetNamespace )...
4
by: Seok Bee | last post by:
Dear Experts, I've completed my console application and now wants to compile the application and an executable file to be run at another location. However, I've tried compiling that program in...
1
by: electrixnow | last post by:
Help!, I need to compile this code with static libs so it run on another XP machine that does'nt have MS Studio installed. When I compile now I get an ERROR: 1>------ Rebuild All started:...
5
by: Torben Laursen | last post by:
Hi Often I just want to compile one c++ file in a project the check it for errors. Now I can right click on a *.cpp file and select "Compile" But is there a way and short cut to compile a file...
2
by: BruceWho | last post by:
I downloaded boost1.35.0 and built it with following command: bjam --toolset=msvc-7.1 --variant=release --threading=multi -- link=shared --with-system stage and it failed to compile, error...
2
by: akhilesh.noida | last post by:
I am trying to compile glibc-2.5 for ARM based board. But I am getting errors while configuring it. Please check and give your inputs for resolving this. configure command : $...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
7
by: QiongZ | last post by:
Hi, I just recently started studying C++ and basically copied an example in the textbook into VS2008, but it doesn't compile. I tried to modify the code by eliminating all the templates then it...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.