Back to home

Topics

1. Smitha wants to create a table customer (Acc no,Name,Address,Amount) in Bank data base,for a VB application.Explain how Smitha can use VB-IDE, for this?

            For,the construction of table through VB-IDE, Smitha can use Add - in → Visual Data Manager.A window titled Visdata will be displayed.From that window New → Microsoft Access → Version 7.0 MDB must be selected .Now the data base Name " Bank . MDB " has to be entered.A data base window will be opened and in that window ' New table ' should be selected.

           Now a table structure window will be displayed.In this window first table name " Customer " has to be entered.Now click on " Add Field " button to enter field details.

           After setting all the fields,the button " Build table " must be clicked.Now the table " Customer" is created in the database Bank. MDB on double clicking the table name in the data base window records can be added to this table.

2. Explain how to link database with a VB application?

              A VB application can be linked with a database through data control.A data control must be placed on the form and do the following property setting.

               1. Select Database Name property and set.Its value to the MDB file we want to link.

               2. Select Record Source property of the table and set its value to an existing table name in the selected database.Now the records of the linked table can be accessed using the Record set object of Data control.

3. Explain the properties of data control?

               Database Name : This property holds the name of Mdb database file from which the table is selected.

               Record Source : This property holds the name of the table from which records are selected.

               Read only : This property indicate whether the table is opened for reading data only.The default setting is false.

               Record Set Type : This property indicate that whether the record set is Dynaset,Snapshot or table type.

4. Explain different record set types?

               These are three types of record set available.

                   a) Dyna Set : This is the default record set type .This type allows records from multiple tables.It is possible to read information from record set and write information to the record set of Dyna set.

                   b) Snapshot : This type allows records from multiple tables.But only reading of record is possible.One cannot edit or update data in the record set.

                  c) Table : This type allows data from only one table.Reading of records from the table and writing of information to the table are possible.

5. Compare Record Source property with Data Source property?

              Record Source is the property of Data control to indicate the table name associated with it.Data Source property is the property of a bound control to mension the data control associated with it.

6. Explain move methods for navigation?

            Move methods - Move First,Move Next,Move Previous,Move Last are used for changing the record pointer sequentially .The usage is Data 1.Record set.Move First.

      Move First : Position the record pointer on 1st record

      Move Next : Position the record pointer on next record

      Move Previous : Position the record pointer on previous record

      Move Last : Position the record pointer on last record

7. What is condition at Navigation?What are the methods used for this?

               Conditional Navigation on record set indicate the positioning of record pointer on a record that satisfy a given criteria.Find methods are used for conditional Navigation.

8. Explain Find methods?

               The Find methods are

                Find First : Position the record pointer on the first record satisfying the given condition.

                Find Next : Position the record pointer on the next record satisfyind the given condition.

                Find Previous : Position the record pointer on the previous record satisfying the given condition.

                Find Last : Position the record pointer on the previous record satisfying the given condition.

9. Write a VB statement for the following?

                (i) Search for a name Aby.

               (ii) Search for  Last customer whose amount is greater than or equal to 5,000.

   (i) Data 1.Record set . Find First " Name = Aby "

   (ii) Data 1 . Record set . Find Last " Amount >=5000 ".

10. Explain the use of Fields property with an example?

                  Fields property is used for extracting information from a table.Suppose we want to get the Name of first record in the record set.We can use the following code.

                   Data 1.Record set.Move First

                   Msg Box " Data 1.Record set.Fields ("Name")

Above example displays the name of first record in the record set.

11. Write a note on record set Manipulation methods?

              Record set manipulation is the process of creating,editing and deleting the records of a table.This can be done using different methods of record set object.

             a) Add New : Data 1-Record set-Add New will create a new blank record at the end of the table.After setting new values for this record using ' Fields ' property Data 1.Record set.Update is used for making permanent changes in the data base.

            b) Edit : Data 1.Record.Edit is used to make changes in the existing records.

            c) Delete : Data 1.Record set.Delete will remove current record from the table.

            d) Update : Data 1.Record set.Update is used after each Add new and Edit methods to make the changes permanent.

12. Write the steps needed to connect a table content through a VB application?

             Step 1 : Link the given table with a Data control ( say Data 1)

             Step 2 : Position the record pointer on the record to be modified

             Step 3 : Apply command Data 1.Record set.Edit

             Step 4 : Make the new changes.

         Eg:- Data 1.Record set.Fields ("Name ") = Ammu.

             Step 5 : Apply command Data 1.Record set.Update to make the changes permanent.

13. What are the steps to create the database in Visual Data Manager.

             Step 1 : Select Add Ins → Visual Data Manager window is displayed.

             Step 2 : Select File → New → Microsoft Access Database to create,dialog box is displayed.

             Step 3 : Type " Library " as the name of the database in the above dialog box and then click the save button.The Visual Data Manager creates the database file (library . mdb) and opens the database window.

14. What are the Record set properties?

                 Two important properties of the record set are Record Count and Fields.

            Record Count : The Record Count property gives the number of records in the record set collection.

            Fields : The fields property represents the set of columns in the record set.

15. What do you mean by EOF property?

                The EOF property of the record set can be used to check if the end of a record set has been reached while navigating it.The EOF property becomes 'True' when end of the record set is reached.We can use a statement such as the one that is given below to list for EOF condition.

                 If Data 1.Record set.EOF then

                            Msgbox " No more records to display "

                  End If.

16. What do you mean by BOF property?

                   BOF property indicates the beginning of the record set.The BOF property becomes 'True' when the record pointer is at the beginning of the record set.

17. What is data bound controls?

                  Buttons of a data control can be used for navigating through the data base.But during navigation,the data in the respective records are displayed out using data bound control.This is one of the easy method for navigating through the data base.

18. What are the properties of Data bound Text box control?

               A text box connected to a data control is called data bound text box .A text box can be connected to data control using its two properties

               1) Data Source : This property must be set to the name of the data control.

               2) Data Field : This property must be set to any one of the fields of the table.

19. Explain how data bound controls are used for record set navigation; using an example?

                 Consider the table student (Roll no,Name,Age).Construct the table and link it with a Data control say Data1.Now design a form as follows.

 

 

 

 

 

Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Powered By