Selecting Database in MDB Format

Thursday, November 18, 2010
Now we select the MS-Access database, do not forget the location we had been save the file. Give the ODBC Name, for example Test.





After finishing connection with ODBC, the name of ODBC will shown in User DSN Tab.

Creating Module For Database Connection

We need to create a database connection, there is some connection;1. ODBC (open database connectivity)2. Data Environtment3. Script Module4. ADODC (using ADODATA Control)5. Data Control6. And other
We will discuss some, the first how to use ODBC. ODBC commonly used in MS-Windows. Do the following;Open the control panel in the MS-Windows, select administrative tools, then select the ODBC


Step 1

Choose System DSN Tab, and then Click Add Button as shown below ;


 and then choose driver of database which is used. for example Microsoft Access Driver (*.mdb), this is for recognized Access Database. we can use another driver according with RDBMS as storage data.




After finishing choose the driver click finish button, and we prepare to select the database, of course in mdb format.
 

Introduction to Visual Basic 6.0 Working Environment


After finishing database creation process and table, now we make a program. Previously you have to recognize MS-Visual Basic first. VB 6.0 IDE,
Programming window, toolbar, function, form, components, reference library,  we immediately make the program short.
Open the program MS-Visual Basic 6.0, and then select the new project as shown below;





















Select Standar Exe, and then VB Environtment displayed



















On the left side ToolBox, Form, Project Explorer, Windows Object Properties, On top of that of course Main Menu. You can add Component in Toolbox by Right Click on ToolBox, also you can add project reference by selecting menu project and choose reference. This is very important because may be we need a lot of library for our project.

Table Structure and Index

When we design a table we must determine the size of each field, for tbl_so_sales_details here is the size ;

  1. sales_number : text : 15
  2. revision_number : text : 3
  3. sales_status : text : 15
  4. customer_code_orig : text : 15
  5. cco_name : text : 100
  6. reference : text : 255
Also do not forget to make the index to speed up the search process, to avoid double data. as shown below













this table has 2 (two) field for primary key, sales_number and revision_number. if there is a process that insert row data for manipulation process, sales_number  and revision_number same data with another row will be rejected.

give the name of the table is tbl_so_sales_details.
Now you have table for data storage.
 

Creating Table

Tables used for data storage media, should be well organized table, the table must have indexes to facilitate the search data. There are times when the index consists of one or more fields.
  
Click table button on the left side as shown below ;

















Click Link Create Table in Design View for creating table; 
Insert field which is representative for that table like structure below
  1. sales_number
  2. revision_number
  3. sales_status
  4. customer_code_orig
  5. cco_name
  6. reference 
Each field must have measurement or can be called length of data, and also type of data storage, there is a lot data type such as
  • Text for Character
  • Number for Nominal and can be count 
  • Memo for large number of character
  • Date / Time for Date / Time
  • and etc
For this case we use text data type









Creating Database Using MS-Access

The database has a table as a basis for media storage, queries to manipulate data, diagrams, relations, each having its own rules. as a basis we will learn to use MS-Access database. Besides easy to use, and integrates with MS-Office.

Open MS-Access, click as shown











Then click the File menu and select New to create a new database as shown below





 












Select Blank Database and Provide a name as you wish, usually tailored to the function file.















Then Click Create button for save the file, you can store it somewhere else, please pay attention and do not forget the storage place for the connection using the program.

Creating Database Applications with MS-Visual Basic 6.0

Before making an application database, you must create a database first. Now we create a database with the open source RDBMS PostgreSQL. Source can be downloaded at or you could have used other databases such as SQLServer, Oracle, and other.

With the assumption you at least understand about the MS-Visual Basic 6.0. If you have not used the program. We'll learn together.

Creating a Database in SQL Server or PostgreSQL, the easier MS-Access. Each RDBMS has the advantage, it all depends on the use or allocation. There is a certain scale which is owned by the RDBMS, if just for a small scale, such as the network, with a small amount of data, not complicated, it is better to use MS-Access, if used for large-scale, enterprise, online systems, please used other RDBMS such SQL SERVER, Oracle, PostgreSQL and other. There is a choice of licensed or even free RDBMS. It all depends on your needs