TheWizardofInt
Well-known member
I am having a problem with an ActiveX.dll which doesnt seem to close out.
In order for the program to work, I open a dBaseIV file like so:
Then I write to the same location through a dynamic link library. Writing with the ADO isnt an option.
Then I try to load the data again, and once in a while the program tells me that it cant open the database, either for an unhandled exception or because it is opened exclusively by another program.
I think that I am either missing a command with the ADO commands for openning the data, or (more likely) the ActiveX dll isnt closing out properly. I just set it to nothing.
Any ideas?
In order for the program to work, I open a dBaseIV file like so:
Code:
Dim myConnection As OleDb.OleDbConnection
Dim myCommand As OleDb.OleDbCommand
Dim myDataReader As OleDb.OleDbDataReader
Dim strSQLQuery As String
Dim sAccNo As String
Dim i As Integer
Dim sName As String
Dim sRecID As String
Dim sSeekFor As String = Request("ID")
If Not Page.IsPostBack Then
query the contact1 database
strSQLQuery = "Select * from contact1 WHERE RecID =" & Session("spassrec") & ""
myConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=d:\asp\gm57\common;Extended Properties=dBase IV")
myCommand = New OleDb.OleDbCommand(strSQLQuery, myConnection)
Try
myConnection.Open()
Catch ex1 As Exception
Response.Write(ex1.GetType)
Response.Write("********")
Response.Write(ex1.ToString)
myCommand = Nothing
myConnection.Close()
myConnection = Nothing
Exit Sub
End Try
Get a new datareader from our command
myDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
If myDataReader.Read Then
do stuff
End if
mydatareader.close
myconnection.close
mydatareader=nothing
myconnection=nothing
Then I write to the same location through a dynamic link library. Writing with the ADO isnt an option.
Then I try to load the data again, and once in a while the program tells me that it cant open the database, either for an unhandled exception or because it is opened exclusively by another program.
I think that I am either missing a command with the ADO commands for openning the data, or (more likely) the ActiveX dll isnt closing out properly. I just set it to nothing.
Any ideas?