'How to connect Oracle Database from Visual Basic
'Sample code and connection strings to connect Oracle using Visual Basic:
Dim conn As ADODB.Connection
' Open a Conn_Dataection using Oracle ODBC.
Set Conn_Data = New ADODB.Connection
Conn_Data.ConnectionString = "Driver={Microsoft ODBC for Oracle};" & "UID=user_name;PWD=user_passsword"
Conn_Data.Open
'Open the table as in:
Dim rs_Data As ADODB.Recordset
' Open the table.
Set rs_Data = New ADODB.Recordset
rs_Data.Open "TableName", Conn_Data, adOpenDynamic, adLockOptimistic, adCmdTable
'Enter the user name password and table name as per the database.
'it must be valid one.
'To reads the data from the table and displays the values in a ListBox
' List the data.
Do While Not rs_Data.EOF
txt = ""
For Each fld In rs_Data.Fields
txt = txt & Trim$(fld.Value) & ", "
Next fld
If Len(txt) > 0 Then txt = Left$(txt, Len(txt) - 2)
List1.AddItem txt
rs_Data.MoveNext
Loop
'Finally close the recordset and close the Conn_Dataection:
rs_Data.Close
Conn_Data.CloseUpdate Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com
atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :