Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connecting Oracle Db using ADO
Message
De
21/12/1999 03:41:17
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Connecting Oracle Db using ADO
Divers
Thread ID:
00306581
Message ID:
00306581
Vues:
55
I 'm having Problem while connecting Oracle Db using ADO.
When I was Created The Recordset ,I cannot find the record Count.
The record Count shows -1.But I can do addnew etc.. The Same Command line I used in MSAccess DB It's Fine.I know if the cursor types
are openDynamic or openforward ,the record Count return as -1.
But other cursor Type also showing the record Count is -1.while connecting oracleDb

The Code As Follows:

Oracle Db
----------
Dim oConn as adodb.connection
Dim oRs as adodb.recordset
Set oConn = New ADODB.Connection
oConn.ConnectionString = "DSN=MyDsn;UID=abc;Pwd=abc"
oConn.Open
Set oRs= New ADODB.Recordset
lcsql = "Select * from update_log "
oRs.Open lcsqltest, oConn, adOpenStatic, adLockPessimistic
(Debug.print ors.recordcount)
x=ors.recordcount
* Actuall there are 25 records in the table


Using Acces Db
---------------

Dim oConn1 As ADODB.Connection
Dim ors1 As ADODB.Recordset

Set oConn1 = New ADODB.Connection
Set ors1 = New ADODB.Recordset
oConn1.ConnectionString = "DSN=Barcoderep"
oConn1.Open
LCSQL1 = "SELECT * FROM Item"
Set ors1 = New ADODB.Recordset
ors1.Open LCSQL1, oConn1, adOpenStatic, adLockPessimistic
a = ors1.RecordCount(Here I can see the record count)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform