Currently I could have the end-user could save the file as a .txt and I
could import that. I would like to avoid this since I would have to rely on
the end-user to export the data properly....and we all know how well that
would work!
Also I could create an odbc connection to the file, but the name of the file
changes each time...again, I have to rely on the intelligence of the
end-user.......
Thanks.
-Rob T.
You can very easy create a dataset from an excel file.
\\\
Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\myExcel.xls;" & _
"Extended Properties=""Excel 8.0;HDR=NO"""
Dim Conn As New System.Data.OleDb.OleDbConnection(ConnectionString)
Dim da As New System.Data.OleDb.OleDbDataAdapter _
("Select * from [Sheet1$]", Conn)
Dim ds As New DataSet
da.Fill(ds, "Sheet1")
///
Be aware that Sheet1 can be in any language different.
I hope this helps a little bit?
Cor
"Cor Ligthert" <notmyfi...@planet.nl> wrote in message
news:Ox7hKGWV...@TK2MSFTNGP14.phx.gbl...
TIA,
John
> I have heard others ask about filling a DS from Excel. What does the
> table structure look like when that is done? Is each column a field?
> and each row a row? Or what?
Yes, and there are two option, one is to skip a headerline from Excel and
one is to get all the columns as string "Text"
Cor
John