検索
IDでの絞込みする
掲示板ID
投稿者
題名
投稿日
soft
梁川
Accessオブジェクトエラーについて
2003/09/06 17:48
エクスプローラー風ファイルコピーを作成しているのですが Accessのハンドルを以下のようにセットすると 実行エラー424 (オブジェクトが必要です)と表示される。なぜ?? 使用環境(VB6 Access2000 OS:Win98) .hwnd = application.hWndAccessApp ’標準モジュールへ記述 Option Explicit Type SHFILEOPSTRUCT hwnd As Long wFunc As Long pFrom As String pTo As String fFlags As Integer fAnyOperationsAborted As Long hNameMappings As Long lpszProgressTitle As String End Type Declare Function SHFileOperation Lib \"SHELL32.DLL\" Alias _ \"SHFileOperationA\" (lpFileOp As SHFILEOPSTRUCT) As Long Const FO_COPY = &H2 Const FO_MOVE = &H1 Const FOF_NOCONFIRMATION = &H10 Const FOF_RENAMEONCOLLISION = &H8 Private Sub Command1_Click() \'次の例では、ファイル\"c:\\My Documents\\Test.mdb\"を\"c:\\Test.mdb\"にコピーします。 Dim stShellOp As SHFILEOPSTRUCT Const cstrSrcFile As String = \"c:\\My Documents\\Test.mdb\" Const cstrDstFile As String = \"c:\\Test.mdb\" With stShellOp .hwnd = application.hWndAccessApp .wFunc = FO_COPY .pFrom = cstrSrcFile .pTo = cstrDstFile End With If SHFileOperation(stShellOp) = 0 Then Beep MsgBox \"コピー完了しました!\" Else Beep MsgBox \"コピーに失敗またはキャンセルされました!\" End If End Sub
削除キー
本当に更新する
---
KONDO-NET.GR.JP
---