URGENT connexion base de donnée access

le manche Messages postés 8 Date d'inscription mardi 3 janvier 2006 Statut Membre Dernière intervention 10 mars 2006 - 3 mars 2006 à 17:13
cs_ikan Messages postés 30 Date d'inscription mercredi 11 mai 2005 Statut Membre Dernière intervention 17 février 2009 - 3 mars 2006 à 18:50
est ce que quelqu'un pourrai m'expliquer comment marche cette connexion

a quoi servent ses deux element "adOpenStatic, adLockOptimistic"

Public Sub MyDatabaseConnection(ByVal DataSource As String, ByVal RecSet As ADODB.Recordset, ByVal Connect As ADODB.Connection, ByVal SQLStr As String)
'
On Error Resume Next
RecSet.Close
Connect.Close ConStr "Provider Microsoft.Jet.OLEDB.4.0;Data Source= " & DataSource & "; Persist Security Info=False"
Connect.Open ConStr
RecSet.Open SQLStr, Connect, adOpenStatic, adLockOptimistic



Exit Sub
'
End Sub

2 réponses

olixelle Messages postés 506 Date d'inscription vendredi 30 juillet 2004 Statut Membre Dernière intervention 3 mars 2008 2
3 mars 2006 à 18:49
ta cherché au moins sur google ???




LockTypeEnum

Specifies the type of lock placed on records during editing.




Constant |
Value |
Description |
----

adLockBatchOptimistic,
4,
Indicates optimistic batch updates. Required for batch update mode.,
----

adLockOptimistic,
3,
Indicates optimistic locking, record by record. The provider uses optimistic locking, locking records only when you call the true#mddefcursor cursor used in a Recordset object.


Settings and Return Values

Sets or returns a CursorTypeEnum value. The default value is adOpenForwardOnly .


Remarks

Use the CursorType property to specify the type of cursor that should be used when opening the Recordset object.


Only a setting of adOpenStatic is supported if the CursorLocation property is set to adUseClient. If an unsupported value is set, then no error will result; the closest supported CursorType will be used instead.


If a =true#mddefdataprovider provider does not support the requested cursor type, it may return another cursor type. The CursorType property will change to match the actual cursor type in use when the Recordset object is open. To verify specific functionality of the returned cursor, use the Supports method. After you close the Recordset, the CursorType property reverts to its original setting.


The following chart shows the provider functionality (identified by Supports method constants) required for each cursor type.




For a Recordset of this CursorType |
The Supports method must return True for all of these constants |
----

adOpenForwardOnly,
none,
----

adOpenKeyset,
adBookmark, adHoldRecords, adMovePrevious, adResync,
----

adOpenDynamic,
adMovePrevious,
----

adOpenStatic,
adBookmark, adHoldRecords, adMovePrevious, adResync

Rollerman
0
cs_ikan Messages postés 30 Date d'inscription mercredi 11 mai 2005 Statut Membre Dernière intervention 17 février 2009
3 mars 2006 à 18:50
bonjour,


voila mon ami : AdOpenstatic c'est un curseur statique,dont toutes les modifications ne sont pas visibles,copie statique d'enregistrement..


AdLockOptimistic c'est un vérrouillage optimsite,les enregistrments ne sont verouilé qu'à l'appel de la méthode Update.



simo
0
Rejoignez-nous