Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to connect to oracle from vb ,

Status
Not open for further replies.

geetapm

Programmer
Feb 12, 2002
17
IN
how to connect to oracle from vb ,
what are all the methods,
one is ODBC, how u connect,
if anyone can help me,
its urgent.

bye
Geeta
 
Connect via ADO. ODBC will work but ODBC is faster and better.

To connect to Oracle on Windows or a UNIX system, you have to have the client connect software installed from Oracle. i.e. If your able to go to the command prompt and type
[tt]tnsping DB_NAME.SERVER_NAME.World[/tt]
then you are connected and it's just a matter of conencting VB to the DB.

Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
ADODB Connection...

Dim conAVB As ADODB.Connection
Dim RS As ADODB.Recordset

Private Sub cmdLoad_Click()

Dim strSQL As String
Set conAVB = New ADODB.Connection

conAVB.ConnectionString = "Provider=MSDAORA;" & _
"Password=" & Password & _
";User ID=" & Username & _
";Data Source=" & HostString & _
";Persist Security Info=True"
conAVB.Open

Set RS= New ADODB.Recordset
strSQL = "Select * from yourtable"
Set RS = conAVB.Execute(strSQL, , adCmdText)

End Sub
 
I'd suggest that you use Oracle's own native OLE DB provider with ADO: it's fast and powerful:
connectstring="Provider=OraOLEDB.Oracle.1;Password=password;User ID=username;Data Source=instancename;
PLSQLRSet=1;
 
thanx to all of u,

i've done it thru ADODB connection
and provider MSDORA

thanx once again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top