Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click
Dim strMdbpath As String
strMdbpath = TextBox1.Text + "\" + TextBox2.Text
If TextBox1.Text = "" Then MsgBox("MDB作成ディレクトリを入力してください") Exit Sub End If If TextBox2.Text = "" Then MsgBox("MDB作成ファイル名を入力してください") Exit Sub End If If Dir(strMdbpath) <> "" Or _ Dir(strMdbpath + ".mdb") <> "" Then MsgBox("すでに存在しています") Exit Sub End If
If MDB_CRTDATABASE(strMdbpath) Then MsgBox("作成しました") Else MsgBox("作成に失敗!") End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load
'ディレクトリを取り出しています Dim strWorkPath As String Dim strPath As String
'アプリケーションディレクトリを取得する strWorkPath = _ System.Reflection.Assembly.GetExecutingAssembly.Location Dim myFileInfo As New System.IO.FileInfo(strWorkPath) MjstrPath = myFileInfo.DirectoryName