SQL, database, table, SELECT query question help!!! *RESOLVED*
background:
ok i know this is simple...and i really don't know why i can't get it to work. i have an access database...that i didn't design...the database has forms and queries designed in it already...i'm designing an app to access the data in a different way....the table i'm trying to access is call Library Information....with that freaking space.
problem:
i write my sql statement in my oledbcommand as follows however i keep getting an exception that the table does exist, i thought that if you use [ ] around a table name with a space in it you can connect to the table...am i crazy? please help...anyway heres the code:
VB Code:
Private Sub LoadLibraries()
Dim LI As LibInfo
Try
adoCmd = New OleDbCommand("SELECT ID, [Library Name] FROM [Libary Information]", adoCnn)
adoRdr = adoCmd.ExecuteReader
While adoRdr.Read()
LI.ID = adoRdr("ID")
LI.LibName = adoRdr("Library Name")
Me.lstbLibs.Items.Add(LI)
End While
Catch ex As Exception
MsgBox(ex.Message)
Finally
adoRdr.Close()
adoCmd.Dispose()
adoRdr = Nothing
adoCmd = Nothing
End Try
End Sub