Sie sind auf Seite 1von 53

Database Replicator

(Oracle to MS-Access)
(Module-1)

Submitted in partial fulfillment of the requirements for the


awards of the degree of
Master of computer application
[Software Engineering]

Guide name: Submitted by:


Dr.Pravin Chandra Mukesh Kumar Pandey
0241644508
M.C.A(SE) Sem-III

University School of Information Technology


GGS Indraprastha University, Delhi-110006
(2008-2011)

1
CERTIFICATE

This is to certify that the project report (IT-755) entitled “Database replicator from

oracle to MS-access” done by Mr. Mukesh Kumar Pandey, Roll no. 0241644508 is

an authentic work carried out by him under my guidance. The matter embodied in

this project work has not been submitted earlier for the award of any degree or

diploma to the best of my knowledge and belief.

Date: Dr. Pravin Chandra


USIT, GGSIPU

2
MODULE DESCRIPTION
As this project is done by two student Mukesh Kumar Pandey and Vijay Kumar kachhap. Following
table illustrate the division of work performed by them individually.

SL.N TASK PERFORMED MODULE:1 MODULE:2


O
1. Generating By manual Yes No
connection By wizard No Yes
string
2 Algorithm design for conversion Yes Yes
process
Splash form Yes No
Login form No Yes
Main form Yes No
3 Coding Conn. Info_ Yes Yes
form
Welcome form No Yes
Add_table form Yes No
Conv_setting Yes No
form
Conversion Yes Yes
form
Splash form Yes No
Login form No Yes
Main from Yes No
4 Designing Welcome form Yes No
Conn. info form No Yes
Add_table form No Yes
Conv_setting Yes No
form
Conversion No Yes
form
5 Testing Yes Yes

Module 1: Mukesh Kumar Pandey.


Module 2: Vijay Kumar Kachhap.

Dr. Pravin Chandra


(USIT)

ACKNOWLEDGEMENT

3
I would like to thank my project mentor, Dr. Pravin Chandra for his guidance. This

project entitled “Database replicator from oracle to MS-Access” could not have been

completed without the flexibility and support provided by him to me to pursue this

project. I wish to thank our project in charge Mr. Sanjay Malik for coordinating the

entire project related activities. At last I wish to express my sincere thanks to all the

authors whose works (both online and in print) we have referred to, in course of my

study of the subject.

Mukesh Kumar Pandey


MCA (SE)-IIIrd Sem.
0241644508
USIT, GGSIPU
mkpandey08@gmail.com

4
Table of contents

Contents
page no
1. Problem statement

8 2. Software Requirements Specification (S.R.S)

2.1Introduction 9

2.1.1 Purpose 9

2.1.2 Scope 9

2.1.3 Definitions, Acronyms, and Abbreviations 10

2.2. Overall Description 10

2.2.1 Product Perspective 11

2.2.1.1 System Interfaces

11

2.2.1.2 User Interfaces 11

2.2.1.3 Hardware Interfaces 12

2.2.1.4 Software Interfaces 12

2.2.1.5 Memory Constraints

12

2.2.2 Product Functions

13

2.2.3 Constraints 13

2.2.4 Assumptions and Dependencies 14

5
2.3. Specific Requirements

14

2.3.1 External Interface Requirements 14

2.3.2 Functional Requirements 14

2.3.2.1 Validity checks on the inputs

15

2.3.2.2 Exact sequence of operations 15

2.3.2.3 Responses to abnormal situation 15

2.3.3 Performance requirement 16

2.3.4 Logical Database requirements 16

2.3.5 Software System attributes 16

2.3.5.1 Reliability 16

2.3.5.2 Availability

16

2.3.5.3 Security

16

2.3.5.4 Maintainability

16

3. Data flow diagram 17

4. Algorithm for conversion process 18

5. The Source Code: 19

5.1module 1

19

6
5.2splash screen

19

5.3Login Form 20

5.4Welcome Form 23

5.5Step1 Form 23

5.6Step2 Form 27

5.7Step3 Form 32

5.8Step4 Form 34

5.9Step5 Form 40

6. Snapshots

42

6.1splash form 42

6.2Login form 43

6.3 Welcome form 44

6.4 Conn_info form

45

6.5 Add_table form

46

6.6 Conv_setting form 47

6.7 Conversion form

48

6.8 End form 49

7. Test Cases. 50

7
8. References

53

8
Problem statement

A company has its database implemented on oracle database management system.

The size of company is not too large and There is large number of employees which

are more comfortable with using MS-access database management and has very less

knowledge of oracle DBMS. also the GUI feature of MS- Access is easy to

understand. So management decided to replicate complete database or some selected

tables as per user requirement from oracle to MS-Access. It is not an easy task to

perform manually by creating all table definition in MS-Access and then inserting all

the records. So they require an application software for automate the replication

process. The basic requirement of to be fulfilled by software are

1. Application must generate connection string on the fly. That is there is a

facility to input the connection information.

2. Establishes the connection to oracle database and report any error occurs in

establishing the connection.

3. Displays the all table names which are accessible by the user.

4. Facility to select one or more tables for replication to MS-Access

5. Create the corresponding table in ms access database.

6. The application can convert any number of tables that are selected by user

7. The application copies the content of oracle table to MS-Access table.

8. Also there is functionality to create blank tables without any data having same

table definition as in oracle.

9. Facility to provide the location where the replicated database to be created.

9
2. Software Requirement Specification

2.1. Introduction:

2.1.1 Purpose

The purpose of this documentation is to present the capabilities that will be

provided by software application “Database Replicator (From oracle to access) ”.

This documentation also states the various required constraints by which the system

will abide.

2.1.2 Scope:

The software product “Database Replicator from Oracle to MS-Access “is an

application which converts an oracle database to an access database. The application

generates the connection string on the fly by using connection information provided

by user. The application then establishes the connection to oracle database displays

the all table accessible by that particular user. Then user can select and convert one

or more table in MS-Access format. This application also provides the functionality

to convert only the table definition without transferring the content.

This application can be in situation where the some company has its complete

database implemented on oracle database, but some tables are required by a

employee for some further processing but employee doesn’t have knowledge of

oracle instead he has good experience of working on Access databases then oracle

administrator can convert that particular tables in MS Access format give it to him.

10
2.1.3 Definitions:

DSN: Stands for data source name

It specifies the source name from where the data is coming.

Connection string:

Connections string has information required to connect to a database. It generally consist

of information of provider, drivers, data source, user name, password etc.

Record set: Recordset object is used for the management of records that result from

database request.

DBA: - Data base administrator

2.2 Overall Description:

A data base is an ordered set of data that is usually saved in one or several files

that belong together. The data is structured as tables, with reference from one

table to another being possible.

There are various type of database management system are available for use like

DB2, oracle, MS-Access. All of them has their own advantages and

disadvantages.

MS-Access is treated comparatively simple than other database system in terms

of learning and using but not suitable for large databases.

11
Some time the user need to replicate the database of one format to another for

taking advantage of that database system.

The application “Database replicator from oracle to MS- Access” convert

database from oracle to MS Access format. This application is general purpose

that is it can convert oracle database of any size and consisting of any number of

tables. There is also functionality to replicate database schema without

transferring data. The application takes data source name (DSN), user name,

password, as the input. User must have proper right to use the oracle the

database. Then it establishes the connection to oracle database. After successful

establishing of connection the application fetches the table definition from data

dictionary of oracle database which is store in dollar tables. And uses this

information to the create access tables. The location of for storing the newly

created MS- Access data base is specified by user.

2.2.1Product Perspective:

This application is fully windows based, self contained and independent software

Product

Database replicator
application
Oracle Access
database database

2.2.1.1 System Interface:

None

2.2.1.2 User Interface:

12
This system has very user friendly and menu based interface. Following screens

will be provided:

1. A login screen for entering the username, password and user name. Access

to different screens will be based on the information provided.

2. There is the screen for capturing the information required for establishing the

connection with oracle database.

3. There is a form in which user can specify the location for crating the MS-

Access database. Also he can specify that, if only database definition is to be

replicated or database definition together with data stored in database.

4. There is a screen in which user can select one or more table to be converted.

5.There is a screen in which user can see the fields or columns exists in particular

table selected be the user

2.2.1.3 Hardware Interface:

The hardware interfaces for this application are

i. Screen resolution of at least 800 x 600 for proper and complete

viewing of screens. But performs best at 1024 x 768.

ii. Proper hardware configuration for running oracle and MS-Access databases

2.2.1.4 Software Interface:

The software interfaces for this application are:

I. Windows XP/ windows 98

ii. MS Access 2003 or any higher version of MS Access as the DBMS for

database.

iii. Visual Basic 6- for coding /developing the software.

13
iv. Oracle database

2.2.1.5 communication interfaces

none

2.1.5 Memory Constrains:

At least 128 MB ram and 1 GB hard disk space will be required.

2.2.2 Product Functions:

The system will allow access only to authorized users. Those can access the

oracle database can establish the connection by providing the connection

information.

Following are the major functions that will be provided by the system:

I. Login facility for enabling only authorized access to system.

ii. Authorized user specifies the connection information require to connection.

iii. The application establishes the connection on the run time.

iv. The application provides the list of table name accessible by that particular

user.

v. Then it accesses the table definition from data dictionary of oracle database.

vi. using the above information it convert the selected table into MS-Access

format.

2.2.3 Constraints:

I. Due to limited features of DBMS being used performance tuning features

will not be applied to the queries and thus the system may become slow

With the increase in number of records.

14
ii. Due to the limited features of the DBMS database Auditing will also not

be provided.

iii. Administrator will have to implement a security policy to safeguard the

Records from unauthorized users.

iv. The present version of application also not maintain the referential integrity

constraint

2.2.4 Assumptions and Dependencies:

I. A user must have the knowledge of using data link properties of database.

ii. The user must know username and password to access oracle database.

2.3. Specific Requirements:

This section contains the software requirements to a level of detail sufficient to

enable designers to design the system, and testers to test that system.

2.3.1 External Interface Requirements:

2.3.1.1 User Interfaces:

The following screens will be provided to the users:

i. Login Screen: from this screen the user will login to the application.

Various fields

Available for this screen will be

(a) User ID: alphanumeric of length up to 10 characters

(b) Password: alphanumeric of length up to 8 characters

ii. step1 Screen: After logging in successfully by the user the step1 screen of

the

application will appear. The user can enter the connection information for

15
oracle database.

iii. step2 screen: Next screen is step2 screen in which user can select the table

to be converted.

iv. step3 screen: in this screen user can specify the location for the MS-Access

data base to be created. Also can specify whether complete database together

with data, or only table definition to be converted

2.3.1.2 Hardware interfaces

As stated in section 2.1.3

2.3.1.3 Software interfaces

As stated in section 2.1.4

2.3.2 System feature

2.3.2.1 Validity checks on the inputs:

(I) Only the authorized user can access the database and application.

(ii) Each User can convert only those tables which are accessible by him.

(iii) Proper validity checks should be imposed while data is being converted from

one database to other.

2.3.2.2 Exact sequence of operations

The user must have proper right to access he oracle dada abase before using this

application The connection must be established and tested before the replication

takes place. A User can exit from the application whenever he/she wants.

2.3.2.3 Responses to abnormal situation

Error handling and recovery


16
Erroneous data operations are rejected with an error message prompt. No

recovery module is needed as erroneous operation is not allowed to

proceed.

2.3.3 Performance requirement

None

2.3.4 Logical Database requirements:

As this application is not designed for any particular data base hence it does not

has any specific logical database design. The database design for access database

is automatically created by the application using the database schema of oracle

database.

2.3.5 Design Constraints

none

2.3.5.1 Software System attributes:

2.3.5.2Reliability

The system would be reliable enough to save a number of records.

2.3.5.3 Availability

The system has to run as per the requirement of the user.

2.3.5.4 Security

The system will use password protection to allow only authentic users to access

The system according to their privilege.

2.3.5.6 Maintainability

The application is to be designed in a maintainable manner. It should be easy to

17
Incorporate new requirements in the individual modules.

3. Data flow diagram :

Level 0

Oracle database

Database replicator
application

Access database

4. Algorithm for conversion process


STEP1: User enters the connection information.
DSN  Oracle service name
Username Oracle user_id
Password  user password

STEP2: Connection establish with oracle server by generating connection string on


18
the Fly
Conn_string using (DSN, Username and password)

STEP3. List out all the tables resides in oracle server.


Fetch the tables name from USER_TAB_COLUMNS.

STEP4: User selects the tables for conversion from table name provided in step3.
n number of selected tables

Step5: Create a MS – access database file at the specified location by user

For I= 0 to n-1 perform step 5 to 7

STEP5: Fetch the schemas of table(i) from oracle database .


Assign f  no of field in table(i)

For j= to f-1
Fieldname (j) = fetch field name from user_tab_columns view for particular
username
Data type(j)= fetch datatype from user_tab_columns view for particular username
Constraints(j)= fetch constraints from user_contriants view for particular username
Next j

STEP6: Create the table(I) in MS Access using the information acquired from step
5.
STEP7: Accessing the data of table resides in the oracle server in a recordset. Copy
it to MS Access record set

While not recordset.eof


Copy the content of oracle recordset to recordset associated with MS-Access
database
Update the MS-Access recordset.
Next I

STEP8: Conversion completed.


5. CODING

1. Module1:

Public filename As String

Public dbname As String

19
Public conn As New Connection, rec As Recordset

Public dl As New DataLinks

Public constr As String

Public tablename() As String

Public numseltab As Integer

Public fileloc As String

Public sflag As Integer

Public note As String

Public tabname As String

Public temptype() As String

Public tempcolname() As String

Public fldcount As Integer

2. Splash form:

Option Explicit

Private Sub Form_KeyPress(KeyAscii As Integer)

Unload Me

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Form_Load()

ProgressBar1.Value = 0
Timer1.Enabled = True

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Timer1_Timer()


20
Static pro1 As Integer

pro1 = (pro1 + 1) Mod 100

ProgressBar1.Value = pro1

If ProgressBar1.Value = 1 Then

End If

If ProgressBar1.Value = 99 Then

Unload Me

Load MDIForm1

MDIForm1.Show

End If

End Sub
-------------------------------------------------------------------------------------------------------

3. Login Form:

Dim db As Database

Dim rs As Recordset

Private Sub cmdCancel_Click()

text1.Text = ""

text2.SetFocus

cmdcancel.Enabled = False

End Sub
------------------------------------------------------------------------------------------------------
Private Sub Form_Activate()

text1.SetFocus

21
End Sub
------------------------------------------------------------------------------------------------------

Private Sub cmdhelp_Click()

MsgBox "For proceeding to the next window please enter the Valid username and

password.After that press OK.", vbInformation, "HELP BUTTONS"

End Sub

Private Sub cmdOK_Click()

If rs.RecordCount = 0 Then

Exit Sub

End If

rs.MoveFirst

While Not rs.EOF

If rs.Fields(0) = text1.Text And _

rs.Fields(1) = text1.Text Then

MsgBox "Valid User", vbInformation

Unload Me

MDIForm1.Show

Exit Sub

End If

rs.MoveNext

Wend

MsgBox "Invalid User..", vbCritical


'cmdok.Enabled = False

22
'cmdcancel.Enabled = False

'txtuserpassword.Locked = True

text1.Text = " "

text2.Text = " "

text1.SetFocus

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Form_Load()

Set db = OpenDatabase(App.Path + "\log.mdb")

Set rs = db.OpenRecordset("login")

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Timer1_Timer()

Label4.Caption = Time

Label5.Caption = Date

End Sub

-------------------------------------------------------------------------------------------------------

4.Welcome Form:

Private Sub Command2_Click()

frmstep1.Show

frmmain.Hide

Unload frmmain
23
End Sub
-------------------------------------------------------------------------------------------------------
Private Sub Command4_Click()

note = MsgBox("Are you sure you want to Exit the wizard", vbYesNo + vbQuestion,

"Oracle to Access.. 2.0(Ver)")

If note = 6 Then

End

End If

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Form_Load()

End Sub

Private Sub Timer1_Timer()

Label7.Caption = Time

Label5.Caption = Date

End Sub
-------------------------------------------------------------------------------------------------------

5.conn._info Form:

Private Sub Command1_Click()

On Error GoTo flag

If Optwizard.Value = True Then

On Error Resume Next

constr = dl.PromptNew

End If
24
If option1.Value = True Then

Dim dsn As String

Dim username As String

Dim pwd As String

If Txtdsn.Text = " " Then

MsgBox "Enter DSN "

Else

dsn = Txtdsn.Text

End If

If Txtusername.Text = " " Then

MsgBox "Enter the user name"

Else

username = Txtusername.Text

End If

If Txtpwd.Text = " " Then

MsgBox "Enter the Password"

Else

pwd = Txtpwd.Text

End If

constr = "Provider=OraOLEDB.Oracle.1" & ";" & "User ID=" & username & ";" & _

"password=" & pwd & ";" & "Data Source=" & dsn & "; Persist Security

Info=False;"
25
End If

conn.Open constr

MsgBox "CONNECTION SUCCESSFULL", vbInformation

conn.Close

Set conn = Nothing

Exit Sub

flag: MsgBox "CONNECTION FAILED.... CHECK THE CONNECTION

INFORMATION", vbCritical

End

End Sub
------------------------------------------------------------------------------------------------------

Private Sub Command2_Click()

Load frmmain

frmmain.Show

Unload frmstep1

End Sub
------------------------------------------------------------------------------------------------------

Private Sub Command3_Click()

If constr = "" Then

MsgBox ("Enter the connection information")

Exit Sub

Else

frmstep2.Show
26
frmstep1.Hide

Unload frmstep1

End If

End Sub
-------------------------------------------------------------------------------------------------------
Private Sub Command4_Click()

note = MsgBox("Are you sure you want to Exit the wizard", vbYesNo + vbQuestion,

"Oracle to Access.. 2.0(Ver)")

If note = 6 Then

End

End If

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Option1_Click()

If Optwizard.Value = False Then

Txtusername.Enabled = True

Txtdsn.Enabled = True

Txtpwd.Enabled = True

End If

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Optwizard_Click()

If option1.Value = False Then

Txtusername.Enabled = False
27
Txtdsn.Enabled = False

Txtpwd.Enabled = False
End If

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Timer1_Timer()

Label7.Caption = Time

Label5.Caption = Date

End Sub
-------------------------------------------------------------------------------------------------------

6.Add table Form:

Private Sub back2_Click()

Set conn = Nothing

Unload Me

Load frmstep1

frmstep1.Show

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Command1_Click()

If List1.ListCount = 0 Then

MsgBox " invalid opration "

Exit Sub

End If

If List1.ListIndex = -1 Then
28
List1.ListIndex = 0

Else

List2.AddItem (List1.List(List1.ListIndex))
List1.RemoveItem (List1.ListIndex)

End If

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Command2_Click()

If List2.ListCount = 0 Then

MsgBox " invalid opration "

Exit Sub

End If

If List2.ListIndex = -1 Then

List2.ListIndex = 0

Else

List1.AddItem (List2.List(List2.ListIndex))

List2.RemoveItem (List2.ListIndex)

End If

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Command3_Click()

While List1.ListCount > 0

List2.AddItem (List1.List(List1.ListCount - 1))

29
List1.RemoveItem (List1.ListCount - 1)

Wend

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Command4_Click()


While List2.ListCount > 0

List1.AddItem (List2.List(List2.ListCount - 1))

List2.RemoveItem (List2.ListCount - 1)

Wend

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub back5_Click()

Set conn = Nothing

Unload Me

Load frmstep1

frmstep1.Show

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Command6_Click()

Dim I As Integer

ReDim tablename(List2.ListCount)

numseltab = List2.ListCount

For I = 0 To List2.ListCount - 1

tablename(I) = List2.List(I)

30
Next I

Frmstep3.Show

frmstep2.Hide

Unload frmstep2

End Sub
------------------------------------------------------------------------------------------------------
Private Sub Command7_Click()

note = MsgBox("Are you sure you want to Exit the wizard", vbYesNo + vbQuestion,

"Oracle to Access.. 2.0(Ver)")

If note = 6 Then

End

End If

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Form_Load()

Set rec = New ADODB.Recordset

conn.Open constr

Dim I As Integer

Dim a As New ADODB.Command

a.CommandText = "SELECT DISTINCT TABLE_NAME FROM

ALL_TAB_COLUMNS WHERE OWNER='SCOTT'"

a.ActiveConnection = conn

Set rec = a.Execute

While Not rec.EOF


31
List1.AddItem rec.Fields(0)

rec.MoveNext

Wend

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub List1_DblClick()

If List1.ListIndex >= 0 Then

List2.AddItem List1.Text

List1.RemoveItem List1.ListIndex

End If

If List1.ListIndex = List1.ListCount - 1 Then

List2.Selected(0) = True

Else

List1.Selected(0) = True

End If

End Sub

-------------------------------------------------------------------------------------------------------

Private Sub List2_DblClick()

If List2.ListIndex >= 0 Then

List1.AddItem List2.Text

List2.RemoveItem List2.ListIndex

End If

32
If List2.ListIndex = List2.ListCount - 1 Then

List1.Selected(0) = True

Else

List2.Selected(0) = True

End If

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Timer1_Timer()


Label7.Caption = Time

Label5.Caption = Date

End Sub

------------------------------------------------------------------------------------------------------

7.Con_setting Form:

Private Sub Cmdbrowse_Click()

cdlbrowse.Filter = "MS access database file(*.mdb)"

cdlbrowse.ShowSave

dbname = cdlbrowse.FileTitle

text1.Text = cdlbrowse.filename

fileloc = text1.Text

End Sub
-------------------------------------------------------------------------------------------------------

Private Sub Command1_Click()

Set conn = Nothing

Unload Me
33
Load frmstep2

frmstep2.Show

End Sub
-----------------------------------------------------------------------------------------------------

Private Sub Command2_Click()

If opttabschema.Value = True Then

sflag = 1

Else

sflag = 0

End If

Load frmstep4

frmstep4.Show

End Sub

------------------------------------------------------------------------------------------------------

Private Sub Command3_Click()

note = MsgBox("Are you sure you want to Exit the wizard", vbYesNo + vbQuestion,

"Oracle to Access.. 2.0(Ver)")

If note = 6 Then

End

End If

End Sub
-----------------------------------------------------------------------------------------------------

Private Sub Form_Load()


34
opttabdata.Value = True

End Sub
----------------------------------------------------------------------------------------------------

Private Sub Timer1_Timer()

Label7.Caption = Time

Label5.Caption = Date

End Sub
---------------------------------------------------------------------------------------------------

8.Conversion Form:

Private Sub cmdCancel_Click()


note = MsgBox("Are you sure you want to Exit the wizard", vbYesNo + vbQuestion,

"Oracle to Access.. 2.0(Ver)")

If note = 6 Then

End

End If

End Sub
------------------------------------------------------------------------------------------------------

Private Sub Combotablist_Click()

listfields.Clear

ReDim tempcolname(20)

Dim com As New ADODB.Command

ReDim temptype(10)

Dim xtype As Integer

tabname = Combotablist.List(Combotablist.ListIndex)
35
Dim rectemp As Recordset

com.ActiveConnection = conn

com.CommandText = "SELECT COLUMN_NAME,DATA_TYPE FROM

USER_TAB_COLUMNS WHERE TABLE_NAME = " & "'" & tabname & "'"

Set rectemp = com.Execute

fldcount = 0

While Not rectemp.EOF

listfields.AddItem rectemp.Fields("COLUMN_NAME")

tempcolname(I) = rectemp.Fields("COLUMN_NAME")

temptype(I) = rectemp.Fields(1)
fldcount = fldcount + 1

rectemp.MoveNext

Wend

End Sub
----------------------------------------------------------------------------------------------------

Private Sub Command5_Click()

Unload Me

Load Frmstep3

Frmstep3.Show

End Sub
---------------------------------------------------------------------------------------------------

Private Sub Command8_Click()

On Error GoTo error1

36
Dim t1 As Integer

ReDim tempcolname(20)

Dim db As Database

Dim com As New ADODB.Command

Dim datacom As New ADODB.Command

ReDim temptype(10)

Dim rsdata As Recordset

Dim xtype As Integer

Dim db2 As Database

Dim c2 As New Connection

Dim rs2 As New Recordset

Dim str2 As String

If dbname = "" Then

MsgBox "Enter the database name to be created", vbInformation

End If

Set wrk = DBEngine.Workspaces(0)

Set db = CreateDatabase(fileloc, dbLangGeneral, dbVersion40)

c2.ConnectionString = "provider = microsoft.jet.oledb.3.51;" & "data source =" _

& fileloc & ".mdb"

For t1 = 0 To numseltab - 1

Set db = OpenDatabase(fileloc)

Dim rectemp As New Recordset

37
com.ActiveConnection = conn

com.CommandText = "SELECT COLUMN_NAME,DATA_TYPE FROM

USER_TAB_COLUMNS WHERE TABLE_NAME = " & "'" & tablename(t1) & "'"

Set rectemp = com.Execute

fldcount = 0

While Not rectemp.EOF

tempcolname(fldcount) = rectemp.Fields("COLUMN_NAME")

temptype(fldcount) = rectemp.Fields(1)

fldcount = fldcount + 1

rectemp.MoveNext

Wend

If sflag = 0 Then

datacom.ActiveConnection = conn

datacom.CommandText = "SELECT * FROM " & tablename(t1)

Set rsdata = datacom.Execute

End If

Dim k As Integer

Set tabldf = db.CreateTableDef(tablename(t1))

For k = 0 To fldcount - 1

Dim typetemp As Integer

Select Case temptype(k)

Case "VARCHAR2"

38
xtype = dbText

Case "NUMBER"

xtype = dbInteger

Case "DATE"

xtype = dbDate

Case "CURRENCY"

xtype = dbCurrency

End Select

With tabldf

.Fields.Append .CreateField(tempcolname(k), xtype)

End With

Next k

db.TableDefs.Append tabldf

db.Close

If sflag = 0 Then

c2.Open

Set rs2 = New Recordset

rs2.ActiveConnection = c2

rs2.Open tablename(t1), c2, adOpenKeyset, adLockOptimistic

While Not rsdata.EOF

rs2.AddNew

For f = 0 To fldcount - 1

39
rs2.Fields(f) = rsdata.Fields(f)

Next f

rs2.Update

rsdata.MoveNext

Wend

c2.Close

End If

Next t1

Unload Me

Load frmstep5

frmstep5.Show

Exit Sub

error1: MsgBox "Tables conversion failed", vbCritical

End

End Sub
-----------------------------------------------------------------------------------------------------

Private Sub Form_Load()

Dim I As Integer

For I = 0 To numseltab

Combotablist.AddItem tablename(I)

Next I

End Sub
-------------------------------------------------------------------------------------------------------
Private Sub Timer1_Timer()
40
Static pro As Integer

pro = (pro + 1) Mod 100

ProgressBar1.Value = pro

If ProgressBar1.Value = 10 Then

End If

If ProgressBar1.Value = 99 Then

ProgressBar1.Visible = False

End If

End Sub
-----------------------------------------------------------------------------------------------------
Private Sub Timer2_Timer()

Label7.Caption = Time

Label5.Caption = Date

End Sub
-----------------------------------------------------------------------------------------------------
9.End Form:

Private Sub Command8_Click()

MsgBox "THANK YOU FOR USING THIS WIZARD", vbOKOnly, "Oracle to

access..2.0(ver)"

End

End Sub
-----------------------------------------------------------------------------------------------------
Private Sub Timer1_Timer()

Label7.Caption = Time

Label5.Caption = Date
41
End Sub

Private Sub Timer3_Timer()

Static pro As Integer

pro = (pro + 1) Mod 100

ProgressBar1.Value = pro

If ProgressBar1.Value = 10 Then

End If

If ProgressBar1.Value = 99 Then

Label1.Caption = "Conversion completed..."

MsgBox "TABLE CONVERTED SUCCESSFULLY", vbInformation

MsgBox "THANK YOU FOR USING THIS WIZARD", vbOKOnly, "Oracle to

access..2.0(ver)"

End

Timer3.Enabled = False

End If

End Sub
-----------------------------------------------------------------------------------------------------

42
6.Snapshot
Splash Form:

The first page of application is Splash form. Splash form which shows the

application is loading their processing file and going to be start.

Login Form:

43
Login form is used to accept the user information like username

and their respective password. It allows only authorized user who have the

permission to access this software.

Welcome Form(Step1):

Welcome form which gives the information about application to the user that

the user must be closes other running program before going to use this application.

Because may be their some problem occur if other program is running there.

44
Conn._info Form(Step2):

Step2 form which called as connection information form. It is used to ask the

necessary information from the user to fill in the blank .that information is about the

oracle sevice name and their user and password verification and which help to

generate the connection string and establish the connection with oracle server.

Add_table Form (Step3):

45
Add table form which is step3 form .it is used to show the tables that are available

in oracle database. The available tables shown in the list1 and now user can select

their choice of tables what they want to be use for their application. The selected

tables populated into list 2.

Conv_setting Form (Step4):

46
Conversion setting form which is step4 form. It ask the user to select the

appropriate choice for conversion setting like user wants to create only table

definition or they want all the data information with their respected tables. User

also provide the file name and location where they want to save their file.

Conversion Form(Step5):

Conversion form which is step5 form. It is used to provide the view to the

user that they can see the tables with their respective fields. The first list show the

selected tables and list 2 show the corresponding fields. And user can proceed the

process of replication by clicking the convert button.

47
End Form(Step6):

The end form show the conversion is in progress…

After the completion of conversion process a message is generated that show

the message “Table converted successfully”. Which indicate the all the selected are

now converted into MS Access form.

7.Test Cases:
Test case id:1
Before Execution:

48
Purpose: To test the login functionality
Prereq: The oracle services are running
Test Data: loginID = {Valid loginID, invalid loginID,
empty}
password = {valid, invalid, empty}
dsn = { valid oracle service name, invalid
service name}
Steps: Steps to carry out the test.

1. visit Login Page


2. enter userID
3. enter password

4. click connect button


Expected output • if login information is correct then
• display connection successful
• else

• display connection fails


Post condition Connection established with oracle server

After Execution

49
Purpose: To test the table selection functionality
Prereq: The oracle services are running
Test Data: None
Steps: Steps to carry out the test.

1. visit to table selection form


2. Select any table name from list box1
3. Click add or add all button

Expected output Selected tables transferred in listbox2


Post condition Selected Tables are removed from list1 and
added in list2

Test case id: 2


Before Execution:

Test history none

result: Connection successful

If fail, any possible reason Login information is incorrect

Any other observation none

Run by: mukesh

50
After Execution:

Test history none


result: Message showing that no table exist
If fail, any possible reason Problem in error handling during
coding
Any other observation none
Run by: mukesh

51
Test case id: 3
Before Execution

Purpose: To test response of application when user


click add button and list1 is empty
Prereq: The oracle services are running
Test Data: None
Steps: Steps to carry out the test.

1. visit to table selection form


2. Click add or add all button

Expected output Message showing that no table exist


Post condition No change in system state

Test history None


result: Tables placed in list2
If fail, any possible reason No tables exist in database
Or connection was not established
Any other observation none
Run by: mukesh

After Execution:

52
8. Refrences:

53

Das könnte Ihnen auch gefallen