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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| Public Function OPENCONNEXION1()
Dim st As String
Dim strquery As String
Dim flagerr As Long
Dim coderror As Long
Dim MESSERROR As String
Dim ObjFileSystem, ObjEngine
Dim i As Integer, j As Integer
Dim Str2 As String, NomBaseDest As String
Dim basename As String, NomBase As String, dbConnectionString As String
'
On Error GoTo ErrPtnr_OnError
' SQL = True
ACCESS = True
If ACCESS = False And SQL = False Then
MsgBox "Aucun type de base n'est choisie"
Exit Function
End If
If ACCESS = True Then
End If
NomBase = "C:\Users\kdjiko\Desktop\macro mama\BD_MAINTENANCE.mdb"
Connecter = False
dbConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Password=" & ";" & _
"Data Source= C:\Users\kdjiko\Desktop\macro mama\BD_MAINTENANCE.mdb" ' ";"
' "Persist Security Info=TRUE;" & _
' "Jet OLEDB:Database Password=012304"
'ElseIf sql = True Then
' End If
If IsEmpty(dbs) = True Then
Set dbs = Nothing
End If
Set dbs = CreateObject("ADODB.Connection")
dbs.ConnectionString = dbConnectionString
dbs.ConnectionTimeout = 30
dbs.Open
Connecter = True
OPENCONNEXION1 = 0
ErrPtnr_OnError:
MsgBox ("Ready")
'coderror = Err.Number
' MESSERROR = Err.Description
' Select Case coderror
' Case 35602
' flagerr = 1
' Case 0
' GoTo ENDD
' Case Else
' MsgBox "Erreur N° " + Str(coderror) + " " + MESSERROR
' GoTo ENDD
'End Select
' Resume Next
ENDD:
End Function |
Partager