Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB and Oracle
Message
De
24/02/1999 07:50:56
 
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Divers
Thread ID:
00188766
Message ID:
00190879
Vues:
20
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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform