Database Related tutorials
|
|---|
Creating VB database applications using ADO control
Data control is not a very flexible tool as it could work only with limited kinds of data and must work strictly in the Visual Basic environment. To overcome these limitations, we can use a much more powerful data control in VB known as ADO control.
In Lesson 19 and Lesson 20, we have learned to build VB database applications using data control. However, data control is not a very flexible tool as it could work only with limited kinds of data and must work strictly in the Visual Basic environment. To overcome these limitations, we can use a much more powerful data control in VB known as ADO control. ADO stands for ActiveX data objects. As ADO is ActiveX-based, it could work in different platforms (different computer systems) and different programming languages. Besides, it could access many different kinds of data such as data displayed in the Internet browsers, email text and even graphics other than the usual relational and non relational database information.
To be able to use ADO data control, you need to insert it into the toolbox. To do this, simply press Ctrl+T to open the components dialog box and select Microsoft ActiveX Data Control 6. After this, you can proceed to build your ADO-based VB database applications.
The following example will illustrate how to build a relatively powerful database application using ADO data control. First of all, name the new form as frmBookTitle and change its caption to Book Tiles- ADO Application. Secondly, insert the ADO data control and name it as adoBooks and change its caption to book. Next, insert the necessary labels, text boxes and command buttons. The runtime interface of this program is shown in the diagram below, it allows adding and deletion as well as updating and browsing of data.
| | Hits:758 Rate: 3.5(out of 5) Vote:2 Submit Date :2006-03-27 Rate It | Error | Review |
|
| | | |
|---|
Creating an Advanced VB database application
Creating an Advanced VB database application using ADO control.
Creating an Advanced VB database application
Creating an Advanced VB database application using ADO control.
| | Hits:437 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
| | | |
|---|
Creating database applications in VB-Part I
Visual basic allows us to manage databases created with different database program such as MS Access, Dbase, Paradox and etc.
Visual basic allows us to manage databases created with different database program such as MS Access, Dbase, Paradox and etc. In this lesson, we are not dealing with how to create database files but we will see how we can access database files in the VB environment.
In the following example, we will create a simple database application which enable one to browse customers' names. To create this application, insert the data control into the new form. Place the data control somewhere at the bottom of the form. Name the data control as data_navigator. To be able to use the data control, we need to connect it to any database. We can create a database file using any database application but I suggest we use the database files that come with VB6. Let select NWIND.MDB as our database file. To connect the data control to this database, double-click the DatabaseName property in the properties window and select the above file, i.e NWIND.MDB. Next, double-click on the RecordSource property to select the customers table from the database. You can also change the caption of the data control to anything but I use "Click to browse Customers" here. After that, we will place a label and change its caption to Customer Name. Last but not least, insert another label and name it as cus_name and leave the label empty as customers' names will appear here when we click the arrows on the data control. We need to bind this label to the data control for the application to work. To do this, open the label's DataSource and select data_navigator that will appear automatically. One more thing that we need to do is to bind the label to the correct field so that data in this field will appear on this label. To do this, open the DataField property and select ContactName. Now, press F5 and run the program. You should be able to browse all the customers' names by clicking the arrows on the data control.
| | Hits:403 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
| | | |
|---|
SQL in VB
To selectively display records in a recordset, the feature to use is SQL - Structured Query Language. By creating a query (a text string which tells VB what to include in a recordset or what actions to take against the data in a recordset) you can greatly simplify the code you have to write in an application that utilizes databases.
SQL
To selectively display records in a recordset, the feature to use is SQL - Structured Query Language. By creating a query (a text string which tells VB what to include in a recordset or what actions to take against the data in a recordset) you can greatly simplify the code you have to write in an application that utilizes databases. You can even write SQL queries which will modify many records in a single operation. Once I understood the basics, the use of SQL hit me like a revelation. It's easily one of the top 5 features of VB's database handling capabilities!
| | Hits:364 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
| | | |
|---|
Database Controls
Database controls are ideal if you want to get in, get the job done, and then get out. In this section we'll discuss the controls available to the database programmer. VB falls short, however, in helping beginners create databases from scratch.
Database Controls
Database controls are ideal if you want to get in, get the job done, and then get out. Microsoft has done an excellent job of making it easy for a beginner to utilize existing databases in their applications. In this section we'll discuss the controls available to the database programmer. VB falls short, however, in helping beginners create databases from scratch. Note that I don't say VB doesn't have powerful database support, because it does. But beginners can easily get lost in the maze of detail that surrounds VB database creation and manipulation.
| | Hits:328 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
| | | |
|---|
Databases
In this section I'll talk about how to use the database features of VB, but I'll also talk about when those features are overkill and when simpler methods of data storage can be substituted for the VB database methods.
Databases
I've read in print that over 80% of all VB programs require the storage of user/application generated data. That's a pretty big percentage but based on my own experience it's probably about right. The real question is how many of those use database formats such as Access and how many of those use less complicated formats? There are major tradeoffs involved in the selection of a data storage scheme. In this section I'll talk about how to use the database features of VB, but I'll also talk about when those features are overkill and when simpler methods of data storage can be substituted for the VB database methods.
| | Hits:291 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
| | | |
|---|
Creating database applications in VB-Part II
In the previous lesson you have learned how to create a simple database application using data control. In this lesson, you will work on the same application but use some slightly more advance commands.
In Lesson 19, you have learned how to create a simple database application using data control. In this lesson, you will work on the same application but use some slightly more advance commands. The data control support some methods that are useful in manipulating the database, for example, to move the pointer to a certain location. The following are some of the commands that you can use to move the pointer around.
| | Hits:282 Rate: 1.0(out of 5) Vote:1 Submit Date :2006-03-27 Rate It | Error | Review |
|
| | | |
|
|---|
Databases
In this section I'll talk about how to use the database features of VB, but I'll also talk about when those features are overkill and when simpler methods of data storage can be substituted for the VB database methods.
Databases
I've read in print that over 80% of all VB programs require the storage of user/application generated data. That's a pretty big percentage but based on my own experience it's probably about right. The real question is how many of those use database formats such as Access and how many of those use less complicated formats? There are major tradeoffs involved in the selection of a data storage scheme. In this section I'll talk about how to use the database features of VB, but I'll also talk about when those features are overkill and when simpler methods of data storage can be substituted for the VB database methods.
| | Hits:291 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
|
|---|
Database Controls
Database controls are ideal if you want to get in, get the job done, and then get out. In this section we'll discuss the controls available to the database programmer. VB falls short, however, in helping beginners create databases from scratch.
Database Controls
Database controls are ideal if you want to get in, get the job done, and then get out. Microsoft has done an excellent job of making it easy for a beginner to utilize existing databases in their applications. In this section we'll discuss the controls available to the database programmer. VB falls short, however, in helping beginners create databases from scratch. Note that I don't say VB doesn't have powerful database support, because it does. But beginners can easily get lost in the maze of detail that surrounds VB database creation and manipulation.
| | Hits:328 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
|
|---|
SQL in VB
To selectively display records in a recordset, the feature to use is SQL - Structured Query Language. By creating a query (a text string which tells VB what to include in a recordset or what actions to take against the data in a recordset) you can greatly simplify the code you have to write in an application that utilizes databases.
SQL
To selectively display records in a recordset, the feature to use is SQL - Structured Query Language. By creating a query (a text string which tells VB what to include in a recordset or what actions to take against the data in a recordset) you can greatly simplify the code you have to write in an application that utilizes databases. You can even write SQL queries which will modify many records in a single operation. Once I understood the basics, the use of SQL hit me like a revelation. It's easily one of the top 5 features of VB's database handling capabilities!
| | Hits:364 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
|
|---|
Creating database applications in VB-Part I
Visual basic allows us to manage databases created with different database program such as MS Access, Dbase, Paradox and etc.
Visual basic allows us to manage databases created with different database program such as MS Access, Dbase, Paradox and etc. In this lesson, we are not dealing with how to create database files but we will see how we can access database files in the VB environment.
In the following example, we will create a simple database application which enable one to browse customers' names. To create this application, insert the data control into the new form. Place the data control somewhere at the bottom of the form. Name the data control as data_navigator. To be able to use the data control, we need to connect it to any database. We can create a database file using any database application but I suggest we use the database files that come with VB6. Let select NWIND.MDB as our database file. To connect the data control to this database, double-click the DatabaseName property in the properties window and select the above file, i.e NWIND.MDB. Next, double-click on the RecordSource property to select the customers table from the database. You can also change the caption of the data control to anything but I use "Click to browse Customers" here. After that, we will place a label and change its caption to Customer Name. Last but not least, insert another label and name it as cus_name and leave the label empty as customers' names will appear here when we click the arrows on the data control. We need to bind this label to the data control for the application to work. To do this, open the label's DataSource and select data_navigator that will appear automatically. One more thing that we need to do is to bind the label to the correct field so that data in this field will appear on this label. To do this, open the DataField property and select ContactName. Now, press F5 and run the program. You should be able to browse all the customers' names by clicking the arrows on the data control.
| | Hits:403 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
|
|---|
Creating database applications in VB-Part II
In the previous lesson you have learned how to create a simple database application using data control. In this lesson, you will work on the same application but use some slightly more advance commands.
In Lesson 19, you have learned how to create a simple database application using data control. In this lesson, you will work on the same application but use some slightly more advance commands. The data control support some methods that are useful in manipulating the database, for example, to move the pointer to a certain location. The following are some of the commands that you can use to move the pointer around.
| | Hits:282 Rate: 1.0(out of 5) Vote:1 Submit Date :2006-03-27 Rate It | Error | Review |
|
|
|---|
Creating VB database applications using ADO control
Data control is not a very flexible tool as it could work only with limited kinds of data and must work strictly in the Visual Basic environment. To overcome these limitations, we can use a much more powerful data control in VB known as ADO control.
In Lesson 19 and Lesson 20, we have learned to build VB database applications using data control. However, data control is not a very flexible tool as it could work only with limited kinds of data and must work strictly in the Visual Basic environment. To overcome these limitations, we can use a much more powerful data control in VB known as ADO control. ADO stands for ActiveX data objects. As ADO is ActiveX-based, it could work in different platforms (different computer systems) and different programming languages. Besides, it could access many different kinds of data such as data displayed in the Internet browsers, email text and even graphics other than the usual relational and non relational database information.
To be able to use ADO data control, you need to insert it into the toolbox. To do this, simply press Ctrl+T to open the components dialog box and select Microsoft ActiveX Data Control 6. After this, you can proceed to build your ADO-based VB database applications.
The following example will illustrate how to build a relatively powerful database application using ADO data control. First of all, name the new form as frmBookTitle and change its caption to Book Tiles- ADO Application. Secondly, insert the ADO data control and name it as adoBooks and change its caption to book. Next, insert the necessary labels, text boxes and command buttons. The runtime interface of this program is shown in the diagram below, it allows adding and deletion as well as updating and browsing of data.
| | Hits:758 Rate: 3.5(out of 5) Vote:2 Submit Date :2006-03-27 Rate It | Error | Review |
|
|
|---|
Creating an Advanced VB database application
Creating an Advanced VB database application using ADO control.
Creating an Advanced VB database application
Creating an Advanced VB database application using ADO control.
| | Hits:437 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-27 Rate It | Error | Review |
|
|
WebmastersHome.com Discussion about programming, SEO, WebHosting and more! |
|