DataAdapter Force Close

jglobe

Member
Joined
Aug 27, 2005
Messages
12
Programming Experience
1-3
Wonder if anyone can help me close a DataAdapter? After closing the adapter and destroying all the objects associated my .NET application retains an open handle to the database folder "dbDir" containing the dbf files. I used Sysinternals ProcessExplorer and the folder handles get created on the first select command and then never get released again. The sqlRD is a SQLServer table that has a list of dbf files to select from to fill my dataset.

VB.NET:
Dim dbf1Conn As New Odbc.OdbcConnection("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=" & dbDir & ";") ' "Provider=Microsoft.Jet.OLEDB.4.0;Mode=Share Deny None;Data Source=" & dbDir & "\;Extended Properties=dBASE IV") ';User ID=Admin;Password=" ")
Dim dbf1DA As New Odbc.OdbcDataAdapter
Dim dbf1Command As Odbc.OdbcCommand
Dim dbf1Database As New DataSet
dbf1Conn.Open()
dbf1Command = New Odbc.OdbcCommand
dbf1DA.SelectCommand = dbf1Command
dbf1DA.SelectCommand.Connection = dbf1Conn
Do While sqlRD.Read
dbf1Command.CommandText = "Select * From " & sqlRD("dBaseName")
dbf1DA.Fill(dbf1Database, sqlRD("LONG_NAME"))
Loop
dbf1Database = Nothing
dbf1Command.Dispose()
dbf1DA.Dispose()
dbf1Conn.Close()
dbf1Command = Nothing
dbf1DA = Nothing
dbf1Conn = Nothing
 
Back
Top