1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
   | Option Explicit
' Variables publiques
Public i As Integer
Public j As Integer
 
' Répertoire de l'application
Public strFolder As String
 
' Objets ADO
Private cnnCli As ADODB.Connection
Private rstCli As ADODB.Recordset
 
Public Function OuvreBase() As Boolean
 
' Ouverture de la base SPAC.accdb
On Error GoTo Err:
Set cnnCli = New ADODB.Connection
With cnnCli
   .Provider = "Microsoft.ACE.OLEDB.12.0"
   .Open strFolder & "SPAC.accdb"
End With
On Error GoTo 0
OuvreBase = True
Exit Function
 
Err:
On Error GoTo 0
OuvreBase = False
MsgBox "Problème lors de l'ouverture de la base SPAC.accdb", vbExclamation
End Function  | 
Partager