473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

I am getting error "user defined type not defined" while compiling code in vb6 .the b

Expand|Select|Wrap|Line Numbers
  1. FORM  SECTION
  2.  
  3. Private Sub command1_click()
  4. tsql$ = "SELECT empname From employee"
  5. tsql$ = tsql$ & "where empid = 1 "
  6. Set rs = cn.Execute(tsql, openstatic, LockReadonly)
  7. While Not (rs.BOF Or rs.EOF)
  8. txtEmployeename.Text = rs(0)
  9. rs.MoveNext
  10. Wend
  11.  
  12.  
  13. End Sub
  14.  
  15. Private Sub ee_DragDrop(Source As Control, X As Single, Y As Single)
  16.  
  17. End Sub
  18.  
  19. Private Sub Form_Load()
  20. datafile = "C:\database2.accdb"
  21. With cn
  22. .Provider = "microsoft.ACE.OLEDB.12.0"
  23. .ConnectionString = datafile
  24. .Open
  25. cboTask.Clear
  26. End With
  27. End Sub
  28.  
  29.  
  30.  
  31.  
  32. MODULE SECTION
  33.  
  34.  
  35. Global cn As New ADODB.Connection
  36. Global rs As New ADODB.Recordset
  37. Global datafile As String
THe above code is for connecting to a database in access and to display the contents in it.
When I compile the above code i am getting error message as "user defined type not defined".I have included
Microsoft ADO EXT 2.8 for DDL and Security
Microsoft DAO 3.6 Object library
Sep 26 '12 #1
3 5071
MikeTheBike
639 Expert 512MB
Hi

Just my two penney worth, shouldn't you have a reference to the Microsoft ActiveX Data Objct xxxx Library ??

I don't think the ADO EXT DDL libary has Connection/Recordset objects. The the DAO 3.6 library does have, but that isn't ADO!!

Don't know if that helps.

MTB
Sep 26 '12 #2
Killer42
8,435 Expert 8TB
It might help if you indicate which line reports the error.
Sep 26 '12 #3
Stewart Ross
2,545 Expert Mod 2GB
MTB is right - you've included the wrong library. Look for one that is along the lines of

Microsoft ActiveX Data Objects 2.1

or whatever the latest version is that is available on your system.

-Stewart
Sep 26 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Vance Kessler | last post by:
Yes, yes, I know why are we using Crystal 7 under Windows 2003. Well we have to for now. We had a website that was working just fine under Windows 2000 then we re-staged the boxes upgraded to...
3
by: H. S. | last post by:
Hi, I am trying to compile these set of C++ files and trying out class inheritence and function pointers. Can anybody shed some light why my compiler is not compiling them and where I am going...
11
by: MLH | last post by:
I copied the following code snippet from A97 HELP. Am getting an error at compile time suggesting there's a problem with the first line (compile error, user-defined type not defined). It is likely...
1
by: John Beard | last post by:
I downloaded the attached code from MS. It flips on the "User Cannot Change Password" on a user in AD and works great from a console or windows app, but when put into an ASP.NET app I get a "The...
1
by: ranabhavin2 | last post by:
Hi, I have made database chat application in asp.net. now suppose I have two chat window at different computer. If user1 writing something to user2 then at the bottom there shuold be message...
0
by: whosyodaddy1019 | last post by:
Does anyone have any code that can do this. From what I understand, these are flags in the "userAccountControl" properties but unsure how to get it unchecked. Can anyone help? Imports System...
0
by: FrankieBakerJr | last post by:
Hello all I have an ASP.NET 2003 application (running Windows XP) that allows user to change and reset their Active Directory password. I'm using an admin account to query and reset the passwords...
7
by: Bill Davy | last post by:
I want to be able to write (const char*)v where v is an item of type Class::ToolTypeT where ToolTypeT is an enumeration and I've tried everything that looks sensible. There's an ugly solution, but...
6
by: p4willi | last post by:
I've defined two arrays in a Module called PubVars Public Type LinesRec CORRECT As Integer QUESTION As String PROC As Integer PAY As Integer End Type Public Lines_Array() As...
1
by: Shelley Burke | last post by:
Many thanks for the coding provided in an earlier thread to be able to snapshot document, save as pdf and email it. Unfort I have done everything as instructed and am still having problems. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.