Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Datareader error - High priority
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Datareader error - High priority

 Post Reply Post Reply
Author
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Topic: Datareader error - High priority
    Posted: 20 September 2003 at 8:06am

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
Gone..
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2003 at 10:58am

Account. mdb

should be

Account.mdb


Lead me not into temptation... I know the short cut, follow me.
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2003 at 11:09am

I know, it is like that, it is just that I copied it staight from VS.NET, so somehow a <space> got in it. I'll edit it.

Besides, if it really was that, the error would have been different and should be triggered at VerifyConnection.Open()



Edited by Diep-Vriezer
Gone..
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 22 September 2003 at 12:05pm
Please reply  it has been here almost a week now and not really usefull stuff...
Gone..
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 23 September 2003 at 6:55am

Originally posted by Diep-Vriezer Diep-Vriezer wrote:

Please reply  it has been here almost a week now and not really usefull stuff...

ya know man.. if someone knew the answer and could reply, rest assured that they would...

no reason to needlessly "bump" your post

Contribute to the working anarchy we fondly call the Internet
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 23 September 2003 at 7:56am

True, I should have shut up, but now I already did it..



Edited by Diep-Vriezer
Gone..
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.