CODE SOURCE VB6
MYRIAM
-
Nab001 -
Nab001 -
Bonjour,JE SUIS EN STAGE J4AI STOSKER MES DONNEES DANS UNE BASE DE DONNEES DE TYOE ACESS ET J'AI DEVELLOPE UNE INTERFACE VB 6 COMMENT FAIRE POUR OUVRIR UNE CONNECTION VERS MA BASE
Configuration: Windows XP Internet Explorer 6.0
1 réponse
-
' dans un module standard ...
Public CN As New Connection
Sub INITiAL()
Dim cheminDbabs As String
If CN.State = adStateOpen Then CN.Close
'"""""""" app.path --->retourne le chemin de votre projet
cheminDbabs = App.Path & "\nom_base.mdb"
'"""""""tester l'existance de la base""""""""""""""""""""
If Dir(cheminDbabs) = "" Then
MsgBox " Base Inexistante !!!", vbInformation
Exit Sub
End If
'"""""""""chemin de connection standart pour toute connection access""""""""""
CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & cheminDbabs & ";" & _
"Jet OLEDB:Database Password="
End Sub