Private Shared Function GetConnectionString() As String
Dim conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\...\Common\C1NWind.mdb;"
Return String.Format(conn)
End Function
Private Function GetDataSource(ByVal connectionString As String) As DataTable
'接続文字列を設定します
Dim conn As String = GetConnectionString()
'SQL ステートメントを設定します
Dim rs As String = connectionString
'データを DataSet に取得します
Dim da As OleDbDataAdapter = New OleDbDataAdapter(rs, conn)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
'データテーブルを返します
Return ds.Tables(0)
End Function