"submit" to Access DB returns "connection closed"error

The error when I submit data  is as follows:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.

Source Error:

Line 17:             Dim comDatabase As New System.Data.OleDb.OleDbCommand(strSQL, conDatabase)
Line 18: 
Line 19:             comDatabase.ExecuteNonQuery()
Line 20: 
Line 21:         End Using

Source File: C:\Inetpub\BlahBlahBlah\Default2.aspx.vb    Line: 19

Stack Trace:   I think the error explanation is in the lines saying (CommandBehavior...in the middle where I left a line space above and below

InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.]
   System.Data.OleDb.OleDbConnection.CheckStateOpen(String method) +994883
   System.Data.OleDb.OleDbCommand.ValidateConnection(String method) +25
   System.Data.OleDb.OleDbCommand.ValidateConnectionAndTransaction(String method) +18

(CommandBehavior behavior, String method) +56
   System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +113
   Default2.SendEmail() in C:\Inetpub\BlahBlahBlah\Default2.aspx.vb:19
   ASP.default2_aspx._Lambda$__1(Object a0, EventArgs a1) in C:\Inetpub\BLAHBLAHBLAH\Default2.aspx:79

   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Everything on the pages look and act the way I want them to except this data submission.

I have posted this in the starting out forum here also but I am just anxious.  I apologize if this is forbidden 




3/3/2009 3:23:36 AM
asp.net.access-datasource 4679 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 30

Have you called conDatabase.Open() anywhere prior to line 17 in your code?  If not, put it on line 18.


Regards Mike
My site
3/3/2009 7:38:44 AM

thank you for this.  I have a long thread in "getting started" where David and mailliaw have helped tons and maybe I should not have started another thread.  I apologize.  I will post your suggestion in that thread and see what the other two guys helping say because I am in the middle of additional changes that have already taken place that may confound with your suggestion.

I will close this as answered with gratitude.  Please check my long thread in "getting started"  


3/4/2009 5:38:24 PM

Similar Artilces:

"Access database" and "Login error"
Hey guys,I'm trying to get an Access database to be the location of the username/password combinations. I've done it is as far as I can tell, but I'm now stuck with the following error.These are some of things I have doneSet up the database in ODBC under the name "OdbcServices"Put the database in the "App_data" folder in the website directoryThanks for any help that you guys can give about the error.The Naked Programmer------------------------------------------ Configuration Error Description: An error occurred during the proc...

From "unrestricted access" to "Collection Owner Access"...
... and back. I ran the RBS wizard after upgrading to 2.7 and now my user only have Collection Owner Access. How do I make my user a Unrestricted user again? Stalle -- Staffan ------------------------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Just as a note they are essentially the same thing. For some other info see the following TID numbers: 10090014, 10095953, 3739679. The documentation also covers how to go from RBS to Unrestricted mode as well as I recall. Good luck. Staffan wrote: | .. an...

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <chip@pobox.com> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD Bruce "Bruce Lamb" <lamb.bruce@mayo.edu> wrote in message news:6HgI315nCHA.155@forums.sybase.com... > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

"access to path"...."is denied"
I have a program that opens a csv file and copies all records to a database.  its working fine in development system but when i deploy this to the live system and if i try to copy a csv file on my machine i am getting an error "access to path"..<tempfile.txt> .."is denied.  I am creating a temporary file on the live server and then changing data and then copying records from the temp file to the live databaseThe problem is that the program cannot access the temp file.  Is there a way to change security access rights of the temp file programmatically so tha...

quotes, quotes, quotes...
I am getting this error and I know what is causing it, but I have no idea how to fix it, any help would be great. The script steps through the /var/log/messages file on a linux server and puts The entries into a mysql database. However when it gets to the 'hlt' line in the messages file it just barfs. The single quotes are freaking it out. I know about quotes but not how to use in this situation. Thanks, Paul Error: May 27 17:53:00 localhost kernel: Checking 'hlt' instruction... OK. <----- doesn't like this in the messages file DBD::mysql::st exec...

When is "close" not really "close"
I've had a strange thing occur a couple of times. When I leave at night, I leave my computer on, but close Thunderbird. That way, I can VPN in from home and view the mail store, but still access e-mail through POP3. One night, a week or so ago, I checked POP3 from home and noticed the mailbox was empty. That's impossible; I get about 500 messages a day. So, I took control of my desktop session and looked around. Thunderbird was not visible, but it was still running in the background. I have since determined that if I close it with the "X" icon at upper ...

Replacing "\\" with "\"
Hi all I'm getting this value from a CheckBoxList control - a location of file, i have to remove "\\" and replace it with "\" and pass it to Query, how to do it, i tried with Replace, but coud'nt suceed. "\\\\Blaze10xp\\BLZ_SFS_07\\Sample Excel Files\\Excel Files\\report2.xls" thank's in advance - Prakash.C you tried Replace like this? string newstring = oldstring.Replace(@"\\",@"\");Plese, do not forget to click "Mark as Answer" on the post that helped you. Thanx!My blog: Scenes From A Developer Memory yes i tr...

"Using" or "With"
Hi all Please can someone enlighten to me as regards the difference with the "Using" and "With" statement when accessing data - which is better, what are the limitations and/or any pointers. Many thanks. Regards DaveDavid WinchesterPlease mark as answer if this is the solution.  using gives you the ability to use the connection and it closes the connection directlly after you finish using it. and there is no need to try- cach - finaly. there is no limitation on using USING keywordMuhanad YOUNISMCSD.NETMy Blog || My Photos || LinkedIn I have a dataobject the re...

double quote
hello there...  i tried everything of think but not working the way i wanted to be... not sure what i'm missing...i'm generating a <span> in code behind and then using in javascript.... here is what i'm doing code behind: int i=0string _keywordID = "keyword";string _name = row["visit_info_nm"].ToString().Trim(); String _getElementByID = String.Format("<span id='{0}' OnClick = \"document.getElementById('{1}').value='{2}';\">{3}</span><br>", i, _keywordID, _name, _name); here is what it generate : <span id='1' OnClick = \"document.getElementById('keyword')...

"To" and "From" missing
When I print emails, the words "To" and "From" are blank, even though the "To" name and "From name (addresser, addressee) do show up. This is not a problem for other users on my system. Suggestions In mailbox right click, view. On the message window, right click and choose print options. Make sure print header is checked. -- Barry Merchant NSC Volunteer SysOp *** no email unless requested please!! *** > In mailbox right click, view. On the message window, right click and > choose print options. Make sure prin...

replace the "." with a ","
Oi.... I need to build a small programm in ASP.NET and chose to use C# for it.Now i got everything working but there's one little problem.the first textbox is a double. I need to make it so that when someone enters a "." then it gets replaced by a ","any ideas?Ghan  string blah = "";blah = blah.Replace(".", ",");Ryan Ryan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question...

Using "+" or "||"
Using SQLAnywhere 5.5.04, I've gotten into the habit of using "||" in ISQL to indicate a string concatenation. I needed to paste my SQL statement into the PowerBuilder script painter for some embedded SQL, and PB didn't like the "||" very much at all. I changed it to "+" and it seems to be ok. Do these two operators indicate ~exactly~ the same thing? moin, afaik these two's are not the same! if you're using "||" and any term is NULL then in the resultstring the term will be ignored if you use "+" then the resu...

"Me" is better than "You"
Yes I know, strings are frozen. But let me talk about it, I really can't get through the idea of a PC talkin to me. I consider my PC as an extension of myself, not a dumb companion who addresses Me as You. Yes there are times when I get angry with Him while I work and get wrong calculations etc.., but it really is my fault, Me using wrong istructions and eventually wanting to find someone else to blame, but it's Me. And yes, I consider Thunderbird my mail program, reading my mail on my PC as Me. So I personally like to have Me in the header bar as a compact address ...

Web resources about - "submit" to Access DB returns "connection closed"error - asp.net.access-datasource

Resources last updated: 12/8/2015 10:03:14 AM