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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create connection to oracle database and make recordsets?

Status
Not open for further replies.

macl

Programmer
Sep 15, 2004
65
DE
Hi everybody i have a question
i have a database in Access which i get data from
in order to do so i open the database with the code

Set dbDBSAccessConn = New adodb.Connection
dbDBSAccessConn.Provider = "Microsoft.Jet.OLEDB.4.0"
dbDBSAccessConn.Open (strDatabasePath))

Now i have to change the database though and get the data from a oracle database
does somebody know how i open the oracle database with vb6?
Also how do i make a recordset from a oracle database? is it the same code as with the access database
and then how do i close the connection again?
Thanks a real lot :)
 

that is all that i need for the connection?

oConn.Open "Provider=OraOLEDB.Oracle;" & _
"Data Source=MyOracleDB;" & _
"User Id=myUsername;" & _
"Password=myPassword"


thanks alot :)
 
I think so. Never used Oracle but once the connection is secured I think you should be able to use ADO as normal. If you are using SQL Commands in your code you may have to be careful regarding the syntax from Access to Oracle as Im not sure they are always the same in every case.
 
oh ok i will try it that way then :)
thank you :)
 
Just for reference the MAIN difference (not the only by any means but the one that will catch most people out when writing SQL for Oracle when used to writing SQL for Access
) is that in Oracle you use single quotes (') rather than the double quotes (") you use in Access SQL.

Harleyquinn

---------------------------------
For tsunami relief donations
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top