Displaying an Oracle 10G XE Table with Visual Basic 6.0 - Configure the ADODC Data Control
(Page 3 of 4 )

After you add the control and right click it, you will see a drop-down as shown above. When you click on the ADODC Properties menu item, it pops up a wizard which will guide you to complete the task.
The wizard comes up with the default tab, General, where one of the most important pieces of information is configured, namely the connection. You need to choose a connection to the database. There are three options out of which we will be using an ODBC Data Source Name, known by its frequently used alias, ODBC DSN. Select this option as shown in the picture and click on the New... button.
Creating an ODBC DSN

This brings you to the Create New Data Source window. Again you have three possibilities. Read through the items in the window. We will be using a connection that applies to this machine only, the System Data Source. Click on the button Next.

This brings up the list of database drivers on this machine that allows you to connect to various databases. We will be using the Oracle XE driver that was registered when Oracle 10G XE was installed. Choose this driver by highlighting it. Then click on the button Next.

The next window which pops up is just a message as to what you did so far. Click on the button Next.

This brings up the Oracle ODBC Drive configuration. As usual you need to provide a name for this DSN. Here it is called VB_OraXe. For the TNS (Transparent Network Substrate) Service Name type in the name of the server, XE. The Description refers to the machine on which the sever is running. For UserID, you must use HR, assuming you have established a user of the HR Database by that name. If you have not taken this step, you must do before proceeding further. This is described in the Oracle 10G XE installation manual, or in the online help. You may also read the previous article on the DevShed.com site. You need not configure other items on this window. Click on the OK button to proceed to the next step.

This brings up the Oracle ODBC Driver Connect window asking for credentials. You just need to type in the password (hr) and click on the OK button.

Now in the next screen you can click on the drop-down next to Use ODBC Data Source Name and you should be able to find the ODBC DSN just configured, VB_OraXe as shown.

Next: Connect the ADO Data Control to the table to be displayed >>
More Visual Basic.NET Articles
More By Jayaram Krishnaswamy