Select * From Excel $ ?

Raven65

Well-known member
Joined
Oct 4, 2006
Messages
305
Programming Experience
3-5
Back after a long break =) Good to see you all again.

Had an interesting programming problem this morning, which we found the answer to, but I do not understand why:


VB.NET:
 Dim objConn As New OleDbConnection(strConn)
 Dim strSql As String = "Select * From [group$]"
 Dim objAdapter As New OleDbDataAdapter(strSql, objConn)

 objAdapter.Fill(ProdMan._ProductionManager)

That code works, and populates the data set from an Excel spreadsheet.

Initially however, we had the SQL string as:

VB.NET:
 Dim strSql As String = "Select * From [group]"

Without the $ basically. This code would only return the first 8 records from the spreadsheet.

As I said, we found this and its working now, but I'm not sure I fully comprehend why; can anyone help clarify?

-R
 
Last edited:
The '$' signifies workbook, as this is similar to selecting an excel spreadsheet in pure asp. This might very well be the case in vb.net as well.
 
Back
Top