rajulama wrote:
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=;Data Source=" & fi.DirectoryName
The names used in your code, you're trying to open a directory as a database. You have to give it the path to the .MDB file, not just it's parent directory.
rajulama wrote:
Dim objCmdSelect As New OleDbCommand("select * from table1" & fi.Name, objConn)
On top of that, your SQL query to get the data in table1 (if it even exists in that database) is wrong. You appending the filename to the end of the SQL SELECT statement, which won't work. The filename goes in the Data Source if your connection string, not the SELECT statement.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008