i need help, error: "user defined type not defined"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ana10192000
    New Member
    • Jun 2007
    • 9

    #1

    i need help, error: "user defined type not defined"

    VB6.0

    Private dbParts as Database
    Private dbParts as Recordset


    guys help, i can't execute my program
    compiler error says: " user-defined type not defined "

    i'm not much a knowledgable programmer, i'm still just a student, do explain it in a little bit detailed statements.
    thanks!
  • danp129
    Recognized Expert Contributor
    • Jul 2006
    • 323

    #2
    Try adding a reference to Microsoft ActiveX Data Objects 2.x Library

    Comment

    • jasjas
      New Member
      • Jun 2007
      • 9

      #3
      are u connecting your VB to Database? if yes mayb is the name of your coding are not mach to your database field name.....*mayb only.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by jasjas
        are u connecting your VB to Database? if yes mayb is the name of your coding are not mach to your database field name.....*mayb only.
        That would be picked up at runtime, not by the compiler.

        Comment

        • jasjas
          New Member
          • Jun 2007
          • 9

          #5
          oic..so that i only say "mayb only".

          Comment

          • ana10192000
            New Member
            • Jun 2007
            • 9

            #6
            Originally posted by danp129
            Try adding a reference to Microsoft ActiveX Data Objects 2.x Library
            hi i already did this, but it only says "permission denied"
            what do you think is the prob?
            some of my classmates are also experiencing this. Our instructor is not helping us...

            pls help...

            Comment

            • danp129
              Recognized Expert Contributor
              • Jul 2006
              • 323

              #7
              Originally posted by ana10192000
              hi i already did this, but it only says "permission denied"
              what do you think is the prob?
              some of my classmates are also experiencing this. Our instructor is not helping us...

              pls help...
              So do you get Access denied if you start a blank project and try to add a reference to Microsoft ActiveX Data Objects 2.x Library and just click ok?

              Comment

              • SkinHead
                New Member
                • Jun 2007
                • 39

                #8
                Hey ana10192000....

                Private dbParts as Database
                Private dbParts as Recordset

                Firstly, You Can't Have Two Variables With The Same Name !
                Also, I Think The "user-defined type not defined" Error Is To Do With The Database Type. There Isn't One.

                If You've Managed To Add A Reference To The Microsoft ActiveX Data Objects 2.x Library, Then Try :

                Private conParts as ADODB.Connectio n
                Private rsParts as ADODB.Recordset

                Comment

                • danp129
                  Recognized Expert Contributor
                  • Jul 2006
                  • 323

                  #9
                  haha I hadn't noticed the same names. Shouldn't have to specify ADODB unless some other reference has a 'connection' or 'recordset' class.

                  Comment

                  • Killer42
                    Recognized Expert Expert
                    • Oct 2006
                    • 8429

                    #10
                    If they're still teaching ten year old VB6, maybe they expect the students to use DAO.

                    Comment

                    • ana10192000
                      New Member
                      • Jun 2007
                      • 9

                      #11
                      Originally posted by SkinHead
                      Hey ana10192000....

                      Private dbParts as Database
                      Private dbParts as Recordset

                      Firstly, You Can't Have Two Variables With The Same Name !
                      Also, I Think The "user-defined type not defined" Error Is To Do With The Database Type. There Isn't One.

                      If You've Managed To Add A Reference To The Microsoft ActiveX Data Objects 2.x Library, Then Try :

                      Private conParts as ADODB.Connectio n
                      Private rsParts as ADODB.Recordset
                      sorry it's not

                      Private dbParts as Database
                      Private dbParts as Recordset

                      it must be

                      Private dbParts as Database
                      Private rsParts as Recordset

                      pardon me

                      Comment

                      • ana10192000
                        New Member
                        • Jun 2007
                        • 9

                        #12
                        Originally posted by Killer42
                        If they're still teaching ten year old VB6, maybe they expect the students to use DAO.
                        we're actually using DAO...

                        Comment

                        • ana10192000
                          New Member
                          • Jun 2007
                          • 9

                          #13
                          guys is there any possibility that the VB6 installed on my PC has some missing components that's why it is saying "permission denied"?

                          Comment

                          • danp129
                            Recognized Expert Contributor
                            • Jul 2006
                            • 323

                            #14
                            Originally posted by ana10192000
                            guys is there any possibility that the VB6 installed on my PC has some missing components that's why it is saying "permission denied"?
                            Is it your computer or school computer?

                            Comment

                            • ana10192000
                              New Member
                              • Jun 2007
                              • 9

                              #15
                              Originally posted by danp129
                              Is it your computer or school computer?
                              school computer..

                              the best that i think i can do now is to do my program all over again outside the school... it's nonsense to ask help for those who doesn't want to help...
                              i'm so sad this time but i have no choice...

                              guys thanks

                              Comment

                              Working...