how to load access as database using ListView (VB6)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nhaztieh
    New Member
    • Aug 2007
    • 13

    how to load access as database using ListView (VB6)

    anyone please help me.. what is the syntax,method or code that will use to connect access as database using the List View in VB6..tnx..
    Last edited by MMcCarthy; Oct 6 '10, 02:32 PM. Reason: removing bold tags
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by nhaztieh
    anyone please help me.. wat is the syntax,method or code that will use to connect access as database using the List View in VB6..tnx..

    Can you explain little bit more about your requirement, front-end versons and Back-end versons

    Comment

    • nhaztieh
      New Member
      • Aug 2007
      • 13

      #3
      tnx 4 reply.. i am having a problem in my program..

      my prof want me to create a program add, delete, save, update, edit, and exit button..

      using the List View i need to display my database access2000..i am using vb6..

      CAN YOU HELP ME.. wat code or method am i going to use here??

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by nhaztieh
        tnx 4 reply.. i am having a problem in my program..

        my prof want me to create a program add, delete, save, update, edit, and exit button..

        using the List View i need to display my database access2000..i am using vb6..

        CAN YOU HELP ME.. wat code or method am i going to use here??
        List View is only for read only purpose. you can not edit list view.

        to save, update and delete you have to write Database queryes.

        1. you can list all record in list view.
        2. when you select data in list view then; write code to place the selected data
        in appropriate text box.
        3. in text box you can edit or delete and Save it.

        to fill listview Code will be here

        Comment

        • hariharanmca
          Top Contributor
          • Dec 2006
          • 1977

          #5
          Originally posted by hariharanmca
          List View is only for read only purpose. you can not edit list view.

          to save, update and delete you have to write Database queryes.

          1. you can list all record in list view.
          2. when you select data in list view then; write code to place the selected data
          in appropriate text box.
          3. in text box you can edit or delete and Save it.

          to fill listview Code will be here

          Try your best then post what you had been done. So it will be easy to guide you.


          Good luck nhaztieh

          Comment

          • nhaztieh
            New Member
            • Aug 2007
            • 13

            #6
            yes i have 3 text box for Student Name, Student No., and Student Address

            i'L try your code..tnx again

            Comment

            • nhaztieh
              New Member
              • Aug 2007
              • 13

              #7
              i need to import my database (access2000) what code am i going to use??

              using the List View??

              Comment

              • hariharanmca
                Top Contributor
                • Dec 2006
                • 1977

                #8
                Originally posted by nhaztieh
                i need to import my database (access2000) what code am i going to use??

                using the List View??
                you cannot use listview to load MS acces DB.

                1. Better use ADODB reference to connect database.
                2. then use sql queries like select, update and delete query.

                Is your project is multi user interface (Clients and server)?

                Comment

                • nhaztieh
                  New Member
                  • Aug 2007
                  • 13

                  #9
                  ADODB?? is it similar to ADODC??

                  Comment

                  • hariharanmca
                    Top Contributor
                    • Dec 2006
                    • 1977

                    #10
                    Originally posted by nhaztieh
                    ADODB?? is it similar to ADODC??
                    Yes, But if you know ADODC conectivity then; just try in ADODC, no problem. Both are more or less same code.

                    Comment

                    • nhaztieh
                      New Member
                      • Aug 2007
                      • 13

                      #11
                      huhu.. i dont know what to do.. im a newbie in VB6..

                      any other components instead of ADODB/C to import my database?

                      my prof want me to use the List View to call my database.. i am not familiar in List View and ADO.. huhuhu

                      Comment

                      • nhaztieh
                        New Member
                        • Aug 2007
                        • 13

                        #12
                        i also try d DATA but it seems like there is a problem..

                        Unrecognized database format..

                        Comment

                        • hariharanmca
                          Top Contributor
                          • Dec 2006
                          • 1977

                          #13
                          Originally posted by nhaztieh
                          huhu.. i dont know what to do.. im a newbie in VB6..

                          any other components instead of ADODB/C to import my database?

                          my prof want me to use the List View to call my database.. i am not familiar in List View and ADO.. huhuhu
                          Okay

                          1. Use ADODC to connect your Database
                          2. In List View properties select ADODCName in Datasource
                          3. And for each sub items's Datafield, select Table fields

                          now, your listview will fill with data.

                          Comment

                          • nhaztieh
                            New Member
                            • Aug 2007
                            • 13

                            #14
                            To access your database use the ADO data control. you use it to link the database into your project. Assuming you have the user names and passwords stored in a table in the database the rest is just a little bit of creativity.

                            1. create an ADO control and connect it to the database using it's connection string property

                            2. connect the ADO control to the table containing your users/passes using the controls record source property, ensure that you select cmdTable as the command type (alternatively you could access a query in the same way as this or other access objects but lets stick to tables for now)

                            3. create a flexgrid Hierarchal control and set it up (row and columns amounts etc.) ready to be populated by the database table

                            4. read the data from the table into the flexgrid

                            5. when the user enters the user name / pass you will want to check first for the user name (that it is present in the grid) and then check that the passwords match up ( check the password in the row that is the same as the identified user name row, eg if my user is Sedecrem and a 'Sedecrem' is present on row 6 you will want to check the contents or your password box against row 6, password column). i wont go into specifics but post back if you have trouble with syntax or getting around it.

                            6. as this is a security based program i would recommended putting a password on the database (in Access) so a clever user just doesn't open that to hack your program. You then would put the database password into the password property of the ADO control. also i would ensure that you make the ADO and flex grid invisible

                            7. if your toolbox does not contain the controls i have mentioned you can add them to it by using Ctrl+T in VB, opening the Components dialog.



                            I cant follow his Procedure..plea se guide me..

                            Comment

                            • nhaztieh
                              New Member
                              • Aug 2007
                              • 13

                              #15
                              when i go to Connection String Property

                              There are 3 source of connection:
                              1. Use Data Link File
                              2. Use ODBC Data Source Name
                              3. Use Connection String

                              In No. 2 ..I chose Ms Access Database and click apply..

                              Comment

                              Working...