Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compile error: user-defined type not defined

Status
Not open for further replies.

carmenl

Programmer
May 1, 2002
3
CA
Hi! I need help with a project that I am developing using VB6 and SQL Server. I am setting up a connection that will allow my program to find a file on the network and delete it. I have the following declartions at the top of my form:
Public oConn A Nw ADODB.connection (in my code module where I build the connection)
Public rs As Recordset (in my main form, to find the pathname I need for the delete)
When I try to run, I get the error:
Compile error: User-defined type not defined
I do not understand what is happening as these shouldn't be considered user-defined types. If you have any ideas, please help!
Thanks!
 
If VB doesn't recognise a class it assumes it must be one you defined in the project, which suggests it doesn't know you want to use ADO.

Have you set a Project Reference to ADO?

 
Maybe you have a reference to DAO as well as one to ADO. In that case, The Recordset is ambiguous. So try defining the variable rs as ADODB.Recordset instead of just Recordset.

Hope this helps [smarty]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top