ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old April 21st, 2003, 03:05 AM
Buraque Buraque is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Shimonoseki / JAPAN
Posts: 58 Buraque User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 4 sec
Reputation Power: 6
Invalid operation on closed object

This code is working in my local IIS server, but not working in my website. giving this error:

ADODB.Recordset.1 error '800a0e78'
Invalid operation on closed object

/Adminpages/tableselected.asp, line 72

I am opening a recordset, and NOT closing it or setting it to Nothing. Anyone have any clue?

Thanks in advance for your time.

Code:
Set MyDB = Server.CreateObject("ADODB.Connection")
MyDB.Open Session("dbstring") 
Set MydbSET = Server.CreateObject("ADODB.Recordset")
MydbSET.ActiveConnection = MyDB
MydbSET.Source = "Describe " & Session("tblname")
MydbSET.CursorType = adOpenDynamic
MydbSET.CursorLocation = 2
MydbSET.LockType = adLockOptimistic
MydbSET.Open()
%>
<FORM ACTION="insertdata.asp" METHOD="post" TARGET="_self" LANG='<%= Session("lang") %>'>
  <TABLE WIDTH="100%" BORDER="0" CELLPADDING="2" CELLSPACING="1">
    <TR BGCOLOR="#CCCCCC">
      <TD WIDTH="25%" BGCOLOR="#000000"><FONT COLOR="#CCCCCC"><STRONG> Field</STRONG></FONT></TD>
      <TD WIDTH="32%" BGCOLOR="#000000"><FONT COLOR="#CCCCCC"><STRONG>Insert
            Value</STRONG></FONT></TD>
      <TD WIDTH="20%" BGCOLOR="#000000"><FONT COLOR="#CCCCCC" FACE="Tahoma"><STRONG>Type</STRONG></FONT></TD>
      <TD WIDTH="3%" BGCOLOR="#000000"><FONT COLOR="#CCCCCC"><STRONG>NULL</STRONG></FONT></TD>
      <TD WIDTH="3%" BGCOLOR="#000000"><FONT COLOR="#CCCCCC"><STRONG>Key</STRONG></FONT></TD>
      <TD WIDTH="20%" ALIGN="CENTER" BGCOLOR="#000000"><FONT COLOR="#CCCCCC"><STRONG>Extra</STRONG></FONT></TD>
    </TR>
    <%
BCOLOR = "#CCCCCC"
This is line 72 : While not MydbSET.EOF 
__________________
Sweet smell of a great sorrow lies over the land. Plumes of smoke rise, merge into the leaden sky. A man lies and dreams of green fields and rivers, but awakes to a morning with no reason for waking. He's haunted by the memory of lost paradise. In his youth or dream, he can't be precise. He's chained forever to a world that's departed. It's not enough, it's not enough.
Gilmour

Reply With Quote
  #2  
Old April 21st, 2003, 08:39 AM
imbrokn imbrokn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: NJ
Posts: 428 imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 10
Send a message via AIM to imbrokn
What does your datasource look like? Is it possible that the datasource isn't correct? I'm also curious as you why your dbString is a Session variable. that seems somewhat odd to me. At least the datasource could be correct on your server, but not on the server you upload the code too. In such a case your recordset will never really open, and there the EOF property wouldn't be allowed.

Reply With Quote
  #3  
Old April 21st, 2003, 09:53 AM
Buraque Buraque is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Shimonoseki / JAPAN
Posts: 58 Buraque User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 4 sec
Reputation Power: 6
Theres no problem in my datasource. Actually it works when I use Execute command like:

Set MySET=myDB.Execute("bla bla"). After I set MySET like this my code continues like that:

While not MySET.EOF
Do this and Do that
MySET.MoveNext.
Wend

Some HTML

MySET.MoveFirst
While not MySET.EOF
Do some other things
MySET.MoveNext
Wend

Weird thing is, I can do (MoveFirst and use the Set from the beginning) thing for 2~3 times but after that mySET dissapears. And I have to define it again: MySET=MyDB.Execute("bla bla")...

I cannot use RecordSET, and I have no clue why. Since I can use Execute, it means I have no problem with connecting to database.

Reply With Quote
  #4  
Old April 21st, 2003, 12:04 PM
imbrokn imbrokn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: NJ
Posts: 428 imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 10
Send a message via AIM to imbrokn
You can execute:
"Describe " & session("tblName")

Just wondering if you are sure you have access to this on the server. Also I'm sure you have an adovbs.inc file included or you would get an error before the one you are getting. Then again it is quite strange because if the query wasn't working then myDBset.eof would simply equate to true not generate an error. Have you tried opening the recordset different ways, just to see if you get it working? Even just the basic:
set myDBset = server.createObject("ADODB.RECORDSET")
myDBSet.open "Describe " & session("tblName"), session("dbString")

just some thoughts

Reply With Quote
  #5  
Old April 21st, 2003, 06:31 PM
Buraque Buraque is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Shimonoseki / JAPAN
Posts: 58 Buraque User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 4 sec
Reputation Power: 6
It is solved!

As you said in your first reply, I wrote the connection string directly instead of session variable and it worked .

It is still srange though... I can create a connection object with session variable, but cannot create a recordset with that object...

The reason I wanted to keep my connection string in a session variable is, this is PhPMyAdmin kinda application and I am using same string in many places...

Anyway, It is working now and I think I can figure out something else later on... Put it in an .inc file and include in every page maybe...

Thanks for your time.

Reply With Quote
  #6  
Old April 21st, 2003, 06:44 PM
defjamninja defjamninja is offline
Overly white
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Fresno, CA
Posts: 83 defjamninja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
If your using the same connection string over and over then you could place it in an Application variable in your global.asa file.

Reply With Quote
  #7  
Old April 21st, 2003, 11:48 PM
imbrokn imbrokn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: NJ
Posts: 428 imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 10
Send a message via AIM to imbrokn
Do what def jam ninja says and put it in the application in your global.asa file. I DO NOT recommend putting connection strings in .inc files, unlike asp files aren't parsed as asp files, meaning that if someone knows the name of your .inc file they could easily see our connection string just by browswing to the .inc file...i.e. http://yourhomepage.com/allmysecretstuff.inc. As long as they are in the .asa file they are safe cause iis takes measures to protect this file. And as long as your application is running, you can access the application variable.

Reply With Quote
  #8  
Old April 21st, 2003, 11:56 PM
Buraque Buraque is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Shimonoseki / JAPAN
Posts: 58 Buraque User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 4 sec
Reputation Power: 6
Actually I was wrong when I said the problem is solved. I somehow forgot to update my pages from object.execute to create recordsets... When I start to use Recordset, problem appeared again. But I think I have found the problem...

My -not working- recordset commands are "show tables" or "describe tableNAME". When I use "Select * from members" I have created recordset succesfully.

I think I don't have grant to use "Show" or "Describe" commands, can it be possible?

Reply With Quote
  #9  
Old April 22nd, 2003, 08:44 AM
imbrokn imbrokn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: NJ
Posts: 428 imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 10
Send a message via AIM to imbrokn
I'm hoping that you are using mySQL. If you are then yes it is possible to grant/deny access to both the show tables command and the describe command. I've never used myODBC, which is what I'm assuming you are using, so i don't know how it works. Do those commands return recordsets? This may be a question you want to ask in the mySQL forum.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Invalid operation on closed object


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway