Beruflich Dokumente
Kultur Dokumente
(Oracle to MS-Access)
(Module-1)
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
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.
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
4
Table of contents
Contents
page no
1. Problem statement
2.1Introduction 9
2.1.1 Purpose 9
2.1.2 Scope 9
11
12
13
2.2.3 Constraints 13
5
2.3. Specific Requirements
14
15
2.3.5.1 Reliability 16
2.3.5.2 Availability
16
2.3.5.3 Security
16
2.3.5.4 Maintainability
16
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
45
46
48
7. Test Cases. 50
7
8. References
53
8
Problem statement
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
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
2. Establishes the connection to oracle database and report any error occurs in
3. Displays the all table names which are accessible by the user.
6. The application can convert any number of tables that are selected by user
8. Also there is functionality to create blank tables without any data having same
9
2. Software Requirement Specification
2.1. Introduction:
2.1.1 Purpose
This documentation also states the various required constraints by which the system
will abide.
2.1.2 Scope:
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
This application can be in situation where the some company has its complete
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:
Connection string:
Record set: Recordset object is used for the management of records that result from
database request.
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
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.
11
Some time the user need to replicate the database of one format to another for
that is it can convert oracle database of any size and consisting of any number of
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
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
2.2.1Product Perspective:
This application is fully windows based, self contained and independent software
Product
Database replicator
application
Oracle Access
database database
None
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
2. There is the screen for capturing the information required for establishing the
3. There is a form in which user can specify the location for crating the MS-
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
ii. Proper hardware configuration for running oracle and MS-Access databases
ii. MS Access 2003 or any higher version of MS Access as the DBMS for
database.
13
iv. Oracle database
none
The system will allow access only to authorized users. Those can access the
information.
Following are the major functions that will be provided by the system:
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:
will not be applied to the queries and thus the system may become slow
14
ii. Due to the limited features of the DBMS database Auditing will also not
be provided.
iv. The present version of application also not maintain the referential integrity
constraint
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.
enable designers to design the system, and testers to test that system.
i. Login Screen: from this screen the user will login to the application.
Various fields
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
(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
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.
proceed.
None
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
database.
none
2.3.5.2Reliability
2.3.5.3 Availability
2.3.5.4 Security
The system will use password protection to allow only authentic users to access
2.3.5.6 Maintainability
17
Incorporate new requirements in the individual modules.
Level 0
Oracle database
Database replicator
application
Access database
STEP4: User selects the tables for conversion from table name provided in step3.
n number of selected tables
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
1. Module1:
19
Public conn As New Connection, rec As Recordset
2. Splash form:
Option Explicit
Unload Me
End Sub
-------------------------------------------------------------------------------------------------------
ProgressBar1.Value = 0
Timer1.Enabled = True
End Sub
-------------------------------------------------------------------------------------------------------
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
text1.Text = ""
text2.SetFocus
cmdcancel.Enabled = False
End Sub
------------------------------------------------------------------------------------------------------
Private Sub Form_Activate()
text1.SetFocus
21
End Sub
------------------------------------------------------------------------------------------------------
MsgBox "For proceeding to the next window please enter the Valid username and
End Sub
If rs.RecordCount = 0 Then
Exit Sub
End If
rs.MoveFirst
Unload Me
MDIForm1.Show
Exit Sub
End If
rs.MoveNext
Wend
22
'cmdcancel.Enabled = False
'txtuserpassword.Locked = True
text1.SetFocus
End Sub
-------------------------------------------------------------------------------------------------------
Set rs = db.OpenRecordset("login")
End Sub
-------------------------------------------------------------------------------------------------------
Label4.Caption = Time
Label5.Caption = Date
End Sub
-------------------------------------------------------------------------------------------------------
4.Welcome Form:
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,
If note = 6 Then
End
End If
End Sub
-------------------------------------------------------------------------------------------------------
End Sub
Label7.Caption = Time
Label5.Caption = Date
End Sub
-------------------------------------------------------------------------------------------------------
5.conn._info Form:
constr = dl.PromptNew
End If
24
If option1.Value = True Then
Else
dsn = Txtdsn.Text
End If
Else
username = Txtusername.Text
End If
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
conn.Close
Exit Sub
INFORMATION", vbCritical
End
End Sub
------------------------------------------------------------------------------------------------------
Load frmmain
frmmain.Show
Unload frmstep1
End Sub
------------------------------------------------------------------------------------------------------
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,
If note = 6 Then
End
End If
End Sub
-------------------------------------------------------------------------------------------------------
Txtusername.Enabled = True
Txtdsn.Enabled = True
Txtpwd.Enabled = True
End If
End Sub
-------------------------------------------------------------------------------------------------------
Txtusername.Enabled = False
27
Txtdsn.Enabled = False
Txtpwd.Enabled = False
End If
End Sub
-------------------------------------------------------------------------------------------------------
Label7.Caption = Time
Label5.Caption = Date
End Sub
-------------------------------------------------------------------------------------------------------
Unload Me
Load frmstep1
frmstep1.Show
End Sub
-------------------------------------------------------------------------------------------------------
If List1.ListCount = 0 Then
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
-------------------------------------------------------------------------------------------------------
If List2.ListCount = 0 Then
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
-------------------------------------------------------------------------------------------------------
29
List1.RemoveItem (List1.ListCount - 1)
Wend
End Sub
-------------------------------------------------------------------------------------------------------
List2.RemoveItem (List2.ListCount - 1)
Wend
End Sub
-------------------------------------------------------------------------------------------------------
Unload Me
Load frmstep1
frmstep1.Show
End Sub
-------------------------------------------------------------------------------------------------------
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,
If note = 6 Then
End
End If
End Sub
-------------------------------------------------------------------------------------------------------
conn.Open constr
Dim I As Integer
a.ActiveConnection = conn
rec.MoveNext
Wend
End Sub
-------------------------------------------------------------------------------------------------------
List2.AddItem List1.Text
List1.RemoveItem List1.ListIndex
End If
List2.Selected(0) = True
Else
List1.Selected(0) = True
End If
End Sub
-------------------------------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------------------------------
Label5.Caption = Date
End Sub
------------------------------------------------------------------------------------------------------
7.Con_setting Form:
cdlbrowse.ShowSave
dbname = cdlbrowse.FileTitle
text1.Text = cdlbrowse.filename
fileloc = text1.Text
End Sub
-------------------------------------------------------------------------------------------------------
Unload Me
33
Load frmstep2
frmstep2.Show
End Sub
-----------------------------------------------------------------------------------------------------
sflag = 1
Else
sflag = 0
End If
Load frmstep4
frmstep4.Show
End Sub
------------------------------------------------------------------------------------------------------
note = MsgBox("Are you sure you want to Exit the wizard", vbYesNo + vbQuestion,
If note = 6 Then
End
End If
End Sub
-----------------------------------------------------------------------------------------------------
End Sub
----------------------------------------------------------------------------------------------------
Label7.Caption = Time
Label5.Caption = Date
End Sub
---------------------------------------------------------------------------------------------------
8.Conversion Form:
If note = 6 Then
End
End If
End Sub
------------------------------------------------------------------------------------------------------
listfields.Clear
ReDim tempcolname(20)
ReDim temptype(10)
tabname = Combotablist.List(Combotablist.ListIndex)
35
Dim rectemp As Recordset
com.ActiveConnection = conn
USER_TAB_COLUMNS WHERE TABLE_NAME = " & "'" & tabname & "'"
fldcount = 0
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
----------------------------------------------------------------------------------------------------
Unload Me
Load Frmstep3
Frmstep3.Show
End Sub
---------------------------------------------------------------------------------------------------
36
Dim t1 As Integer
ReDim tempcolname(20)
Dim db As Database
ReDim temptype(10)
End If
For t1 = 0 To numseltab - 1
Set db = OpenDatabase(fileloc)
37
com.ActiveConnection = conn
USER_TAB_COLUMNS WHERE TABLE_NAME = " & "'" & tablename(t1) & "'"
fldcount = 0
tempcolname(fldcount) = rectemp.Fields("COLUMN_NAME")
temptype(fldcount) = rectemp.Fields(1)
fldcount = fldcount + 1
rectemp.MoveNext
Wend
If sflag = 0 Then
datacom.ActiveConnection = conn
End If
Dim k As Integer
For k = 0 To fldcount - 1
Case "VARCHAR2"
38
xtype = dbText
Case "NUMBER"
xtype = dbInteger
Case "DATE"
xtype = dbDate
Case "CURRENCY"
xtype = dbCurrency
End Select
With tabldf
End With
Next k
db.TableDefs.Append tabldf
db.Close
If sflag = 0 Then
c2.Open
rs2.ActiveConnection = c2
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
End
End Sub
-----------------------------------------------------------------------------------------------------
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
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:
access..2.0(ver)"
End
End Sub
-----------------------------------------------------------------------------------------------------
Private Sub Timer1_Timer()
Label7.Caption = Time
Label5.Caption = Date
41
End Sub
ProgressBar1.Value = pro
If ProgressBar1.Value = 10 Then
End If
If ProgressBar1.Value = 99 Then
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
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
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.
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
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
47
End Form(Step6):
the message “Table converted successfully”. Which indicate the all the selected are
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.
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.
50
After Execution:
51
Test case id: 3
Before Execution
After Execution:
52
8. Refrences:
53