Question Retrieving Table List - One DB Errors, One DB Does Not...

jsurpless

Well-known member
Joined
Jul 29, 2008
Messages
144
Programming Experience
Beginner
Hi all

I've got a program that interfaces with an MS Access database, using the following conne

VB.NET:
strMSAccess_Connection_SQL = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strDatabaseFilePath

MSAccess_Connection = New OleDbConnection(strMSAccess_Connection_SQL)

MSAccess_Connection.Open()

where strDatabaseFilePath is the path of my database

I then making use of the following code to retrieve a list of tables (non-system) within the database...

VB.NET:
MSAccess_DataTable = MSAccess_Connection.GetSchema("Tables")

For Each MSAccess_DataTableRow In MSAccess_DataTable.Rows

   If MSAccess_DataTableRow.Item(3) = "TABLE" Then 'Only select user tables, not system tables

      MSAccess_DataTables_List.Add(MSAccess_DataTableRow.Item(2))

   End If

Next

99% of the time this works but then all of a sudden, a user reported that it stopped working with one database in particular... it yields the following error

VB.NET:
Exception Type: System.AccessViolationException

Attempted to read or write protected memory. This is often an indication that the memory is corrupt...

I should mention that it doesn't happen on my PC - not sure why it's any different...

Any thoughts on what might be configured within a database that might cause this?

Thanks!

-Justin
 
Back
Top