Hi all,
Why do I recieve this error:
Invalid attempt to Read when reader is closed.
When I use the following code:
Dim VerifyConnection As New OleDbConnection(), VerifyCommand As New OleDbCommand(), VerifyDatareader As OleDbDataReader, VerifyString As String
With VerifyConnection
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Pub\wwwroot1\Components\Databases\Account\Account. mdb;User Id=admin;Password=;"
End With
With VerifyCommand
.CommandText = "SELECT Ip, Banned FROM tblIpbanned WHERE Ip = '" & Request.ServerVariables("REMOTE_HOST") & "'"
.CommandType = CommandType.Text
.Connection = VerifyConnection
End With
VerifyConnection.Open()
VerifyCommand.Prepare()
VerifyDatareader = VerifyCommand.ExecuteReader()
The error occurs at the bold line. The weird part (or maybe the logic part
) is that this error only occurs when the given IP matches the IP in the database. It doesn't matter if the value in the Banned table is 0 or 1 or something else.
This is a high priority topic (or as I named it) because my site can't bann ip's nor account's now, so I really need an answer.. 
Edited by Diep-Vriezer