W
Wayne Wengert
I am trying to fill a dataset with a list of user tables from an Access
database. When I run the code (below) I get an error on the myDA1.Fill line.
The error message is: "Value cannot be null".
If I copy and paste the SQL string into an Access query it works fine. The
connection string is valid (used in another case).
Any thoughts on what might cause this.
====================================
Dim myDS1 As DataSet
Dim row As DataRow
Dim strTemp As String
strTemp = "SELECT MSysObjects.Name FROM MSysObjects WHERE " & _
" (((MSysObjects.Name) Not Like 'MSys%') AND " & _
" ((MSysObjects.Type)=1)) ORDER BY MSysObjects.Name"
Dim myDA1 As New OleDb.OleDbDataAdapter(strTemp, mConnStr)
Dim ii As Integer = 0
myDA1.Fill(myDS1, "AllTables")
database. When I run the code (below) I get an error on the myDA1.Fill line.
The error message is: "Value cannot be null".
If I copy and paste the SQL string into an Access query it works fine. The
connection string is valid (used in another case).
Any thoughts on what might cause this.
====================================
Dim myDS1 As DataSet
Dim row As DataRow
Dim strTemp As String
strTemp = "SELECT MSysObjects.Name FROM MSysObjects WHERE " & _
" (((MSysObjects.Name) Not Like 'MSys%') AND " & _
" ((MSysObjects.Type)=1)) ORDER BY MSysObjects.Name"
Dim myDA1 As New OleDb.OleDbDataAdapter(strTemp, mConnStr)
Dim ii As Integer = 0
myDA1.Fill(myDS1, "AllTables")