Home » RDBMS Server » Server Administration » Accessing Oracle from Visual Basic -- HELP!
Accessing Oracle from Visual Basic -- HELP! [message #56172] Tue, 11 March 2003 00:12 Go to next message
Joy
Messages: 21
Registered: November 2001
Junior Member
I have developed a Visual Basic program which uses ADODB to connect to and access a MS-Access database. Now, I wish to switch over to Oracle 8i server and use it as the database instead of MS-Access. I will need to connect to the Oracle server over LAN and manipulate my tables using SQL*Net. Could anyone please advise what steps should I follow to easily make the switch over?
Re: Accessing Oracle from Visual Basic -- HELP! [message #56234 is a reply to message #56172] Thu, 13 March 2003 06:00 Go to previous messageGo to next message
Garouppa
Messages: 27
Registered: February 2003
Junior Member
add microssoft ADO 2.5 or better to your VB project, and read the following code

Dim cn As New ADODB.Connection
Dim rec1 As ADODB.Recordset
username="myoracleuser"
password="myoraclepassword"
cn.Provider = "MSDAORA.1"
cn.ConnectionString = "MSDAORA.1;Password=" & PassWord & ";User ID=" & UserName & ";Data Source=" & Serveur & ";Persist Security Info=True"
cn.Open cn.ConnectionString, UserName, PassWord

Set rec1 = cn.Execute("select stuff from table")
while not rec1.eof
rec1.movenext
wend
rec1.close
cn.close
Re: Accessing Oracle from Visual Basic -- HELP! [message #56236 is a reply to message #56172] Thu, 13 March 2003 06:01 Go to previous message
Garouppa
Messages: 27
Registered: February 2003
Junior Member
add microssoft ADO 2.5 or better to your VB project, and read the following code

Dim cn As New ADODB.Connection
Dim rec1 As ADODB.Recordset
username="myoracleuser"
password="myoraclepassword"
cn.Provider = "MSDAORA.1"
cn.ConnectionString = "MSDAORA.1;Password=" & PassWord & ";User ID=" & UserName & ";Data Source=" & Serveur & ";Persist Security Info=True"
cn.Open cn.ConnectionString, UserName, PassWord

Set rec1 = cn.Execute("select stuff from table")
while not rec1.eof
rec1.movenext
wend
rec1.close
cn.close
Previous Topic: Is it logical........?
Next Topic: TEMPorary tablespace
Goto Forum:
  


Current Time: Fri Sep 20 00:26:59 CDT 2024