Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Dim MyConnection As System.Data.OleDb.OleDbConnection
  2. Dim DtSet As System.Data.DataSet
  3. Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
  4.  
  5. MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft Office 12.0 Access Database Engine OLE DB Provider;Data Source=" & filepath & ";Extended Properties=Excel 8.0;")
  6.  
  7. for p as integer = 0 to sheets.count - 1
  8. dim dt as DataTable
  9. MyCommand = New System.Data.OleDb.OleDbDataAdapter("Select * from ["& sheets(p) & "$]", MyConnection)
  10. DtSet = New System.Data.DataSet
  11. MyCommand.Fill(DtSet)
  12. dt = DtSet.Tables(0)
  13.  
  14. if p > 0
  15. response.write(sheets(p))
  16. end if
  17.  
  18. next
  19. MyConnection.Close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement