Dim aa$ Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) aa = Adodc1.Recordset.Fields(3) End SubPrivate Sub Command1_Click() Shell "explorer " & aa, vbMaximizedFocus End Sub
用API:ShellExecute Private Declare Function GetDesktopWindow Lib "user32" () As LongPrivate Declare Function ShellExecute Lib "shell32" _ Alias "ShellExecuteA" _ (ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Dim aa$ Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) aa = Adodc1.Recordset.Fields(3) End Sub Private Sub Command1_Click() ShellExecute GetDesktopWindow ,"open",aa,0,0,1 End Sub
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
aa = Adodc1.Recordset.Fields(3)
End SubPrivate Sub Command1_Click()
Shell "explorer " & aa, vbMaximizedFocus
End Sub
Private Declare Function GetDesktopWindow Lib "user32" () As LongPrivate Declare Function ShellExecute Lib "shell32" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Dim aa$
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
aa = Adodc1.Recordset.Fields(3)
End Sub Private Sub Command1_Click()
ShellExecute GetDesktopWindow ,"open",aa,0,0,1
End Sub