en fait tu veux ouvrir ta base de donnée avec access depuis vb?
C'est bien çà?
Si cest çà j'ai trouvé sur ce site un programme que j'utilise assez souvent
Dans un module tu rentres çà:
Private Type SHELLEXECUTEINFOA
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Function ShellExecuteEx Lib "shell32.dll" (ByRef lpExecInfo As SHELLEXECUTEINFOA) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Const WAIT_TIMEOUT As Long = 258&
Private Const SEE_MASK_DOENVSUBST As Long = &H200
Private Const SEE_MASK_NOCLOSEPROCESS As Long = &H40
Private Const SEE_MASK_IDLIST As Long = &H4
Public Const SW_SHOW As Long = 5
Public Function ExecCmd(ByRef vsCmdLine As String, Optional ByRef vsCurrentDirectory As String = vbNullString, Optional ByVal vnShowCmd As Long = SW_SHOW, Optional ByVal vnTimeOut As Long = 200) As Long
Dim tShellExInfo As SHELLEXECUTEINFOA
With tShellExInfo
.cbSize = Len(tShellExInfo)
.lpDirectory = vsCurrentDirectory
.lpVerb = "open"
.lpFile = vsCmdLine
.nShow = vnShowCmd
.fMask = SEE_MASK_DOENVSUBST Or SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_IDLIST
End With
If ShellExecuteEx(tShellExInfo) Then
Do While WaitForSingleObject(tShellExInfo.hProcess, vnTimeOut) = WAIT_TIMEOUT
DoEvents
Loop
GetExitCodeProcess nProcessID, ExecCmd
CloseHandle tShellExInfo.hProcess
Else
ExecCmd = vbError
End If
End Function
et dans une form avec une command par exemple:
Private Sub Command1_Click()
ExecCmd "C:\.............\*.mdb" 'adresse de ton fichier
End Sub
Voilà çà, çà marche bien (si c'est bien çà que tu veux)
A+
anto37_44
