DATABASE CONNECTIVITY
Date:
AIM:
To Working with VB Forms and Connect the Oracle 10g to Visual Studio 6.0 for Database Connectivity
PROCEDURE:
Step 1: Start All ProgramsVisual Studio 6.0 Choose Standard Exe Form
Step 2: Choose Project In Menubar And Choose The Ado Data Control 6.0
Step 3: Connect The Adodc To Microsoft Oledb Provider For Oracle
Step 4: Data Link Properties Type The Username And Password
Step 5: Click The Test Connection To Make The Connectivity Success
DATABASE CONNECTIVITY:
Step 1:
Add Microsoft Ado Data Control6.0 (OLDEB) From Project Component For Connectivity
STEP 2:
Establish Connection through Connection String From Property Window
STEP 3:
Build Connection through Select Microsoft OLEDB Provider For Oracle
Step 4:
Entering username and password for check test connection
Step 5:
Test connection successfully made.
ENO
ENAME
SALARY
200
ravi kumar
6000
1001 anbu 15000
1002
bala
20000
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Private Sub Command1_Click()
If (text1.Text = "" Or Text2.Text = "" Or Text3.Text = "") Then
MsgBox ("enter correct data")
Else
Dim str_add As String str_add = "insert into emp values( " & text1.Text & " , ' " & Text2.Text & " ' ," & Text3.Text & " )" con.Execute str_add
MsgBox ("inserted") text1.Text = " "
Text2.Text = " "
Text3.Text = " "
End If
'End If
'End If
End Sub
Private Sub Command2_Click()
If (text1.Text = "") Then
MsgBox ("enter the employee number do u want delete")
Else
Dim str As String str = "delete from emp where eno= " & text1.Text con.Execute str
MsgBox ("record deleted") text1.Text = " "
Text2.Text = " "
Text3.Text = " "
End If
End Sub