General information
Category:
Database DAO/RDO/ODBC/ADO
There are many ways you can access data on oracle. Microsoft wants people to use ADO. Since you are using VB5 you will probably need to download and install the latest OleDB drivers from the Microsoft download page. Then create a DSN to Oracle. Your code will look something like this.
set a reference to the activex data object library 2.0
dim conn as adodb.connection
dim rs as adodb.recordset
set conn = createobject(adodb.connection)
conn.open "DSN name", "OracleUserName", "PassWord"
set rs = createobject(adodb.connection)
rs.open "select * from Table", conn, adopenkeyset, adlockoptimistic
Good Luck,
Michael
>I have an assignment in my Oracle class that requires that I use VB. I have installed VB5 Enterprise, and I am not sure how to go about connecting to the Oracle database. I've created a DSN to Oracle and connected to it. I have tried to install the data components, but it seems that they don't have an odbc component for oracle. Do i have to hard code the db connection? How would this be accomplished?
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only