Page doesn't let go of .ldb file

Andi03

Freshman
Joined
Sep 5, 2003
Messages
43
Hi

Why wont my page let go of the database .ldb file. The only way I connect to my database is via this function:

Code:
Function HamtaData_DataReader(strSQL As String, strDBConnection As String) As OLEDBDataReader
Dim Conn As New OLEDBConnection(strDBConnection)
Dim Cmd As New OLEDBCommand(strSQl, Conn)
Dim DR As OLEDBDataReader

Conn.Open()
DR = Cmd.ExecuteReader(CommandBehavior.CloseConnection)
Return(DR)
End Function

And still the .ldb file excist.
Its the same on my other pages where I have more functions that connect to the database but All of the includes either Conn.Close() or CommanBehavior.CloseConnection

Can someone help me?

I use IIS 5.1, WinXp Pro, Access 2000 and Dreamwaver.

//Andi03
 
Ok you are returning your reader and the connection is still open.

You are not closing your reader. The CommandBehavior.CLose Connection doesnot close the connection, it instructs to close the connection once the reader is closed and i don't see any readers closed.
 
I dont think that will work, because once you return the reader the Function will end and will not execute any more code in the function. You can try use something other than readers, but if you insist on using a reader what you can do is once you are done from it finally outside the function ,once you get the dataq you want close the reader.
 
Back
Top