473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

operation is not allowed when object is open

3
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head><title>testing connection asp to mdb</title></head>
  3. <body>
  4. <%
  5. dim sql_insert,sSQL
  6. src = "C:\websites1\yourdominname\mydatabase.mdb"
  7. sConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & src
  8. ' Uncomment the next two lines and comment the above line to switch between Access and SQL.
  9. Set OBJdbConn = Server.CreateObject("ADODB.Connection") 
  10. Set rs = Server.CreateObject("ADODB.Recordset")
  11. OBJdbConn.Open  sConnStr                    
  12. sSQL =  "SELECT * from friends"
  13. Set rs = OBJdbConn.Execute(sSQL)
  14. Do while not rs.eof
  15.     response.Write(rs.fields("number").value)
  16.     rs.movenext
  17.     Loop
  18.     rs.close
  19.     rs.cursortype = 2
  20.     rs.locktype = 3
  21.     rs.open 
  22.     rs.addnew
  23.     rs("number")=7
  24.     rs.update
  25.     rs.Close
  26.     rs = Nothing
  27.     OBJdbConn.Close
  28.     Set OBJdbConn= Nothing
  29. %>
  30. </body>
  31. </html>
so please reply for this question
my mail address is : [email address removed]
Sep 22 '07 #1
1 2127
jhardman
3,406 Expert 2GB
You do things in a little bit of a different order than I would do it, so I'm not sure what part is giving the error. Which line is sending the error message?

Jared
Sep 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Matthew Louden | last post by:
The following ASP code yields the following error, but actually the new record is stored in database. The same error happens when the application deletes a record, such as sqlStmt ="delete from...
1
by: cliverama | last post by:
help! fried brains.... asp calling a sqlserver7 stored proc which dynamically builds a sqlstatement & passes it to sp_executesql asp page gives the operation not allowed when object is closed...
17
by: James Baker | last post by:
I'm getting an error: "Operation is not allowed when the object is closed." on the lines of code below. I can't imagine why the object would be closed where it says it will be, I've just opened it...
1
by: | last post by:
So, I am getting this really annoying error.. the SQL Statement executes perfectly in Query Analyzer.. all I am doing is basically duplicating a row (insert into select from) from one table back...
2
by: Arpan | last post by:
An ASP application updates a SQL Server database table after a Form is submitted after which the user is directed to another page that should display the updated records. If the code is ...
1
by: amitbadgi | last post by:
Hello guys I am getting this error while converting an asp applicayion to asp.net Exception Details: System.Runtime.InteropServices.COMException: Operation is not allowed when the object is...
8
by: Jim in Arizona | last post by:
I've been using an example out of a book to be able to edit the rows in a database. I am getting the following error: ========================================================...
8
by: Pieter | last post by:
Hi, I'm having some weird problem using the BackGroundWorker in an Outlook (2003) Add-In, with VB.NET 2005: I'm using the BackGroundWorker to get the info of some mailitems, and after each item...
1
by: Matt | last post by:
Got this problem that killing me...what am i doing wrong with this old dll. When i call the function from asp i get "Operation is not allowed when object is closed" any clue will be...
7
vikas1111
by: vikas1111 | last post by:
Hi All.... I have created a form in which i call other forms from the main form .. When i click a perticular botton twice there is an error .. Can anyone help me to solve my problem.. The error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.