|
-
Hammerhead Shark
-
Reef Shark
Ok master , why am I getting this error? ADODB.Connection (0x800A0E78)
Operation is not allowed when the object is closed.
/gradebook/addlesson2.asp, line 49.
BTW the query works in Datasheet view in Access, but it doesn't work at all through the asp page.
<%
Dim Connection,SqlQuery1,SqlQuery2,LessonNameRecordSet,Instructo rSectionRecordSet
Set Connection=Server.CreateObject ("ADODB.Connection")
Connection.Open Session("Rsetstr")
SqlQuery1 = "SELECT Lessons.LessonName FROM InstructorToProduct INNER JOIN (Lessons INNER JOIN LessonToProduct ON Lessons.LessonID = LessonToProduct.LessonID) ON InstructorToProduct.ProductID = LessonToProduct.ProductID WHERE InstructorToProduct.InstructorID = " & Clng(Session("InstructorID")) & ";"
Set LessonNameRecordSet = Server.CreateObject("ADODB.Connection")
LessonNameRecordSet.Open SqlQuery1,Connection,3,3
SqlQuery2 = "Select SectionID From InstructorToSection Where InstructorID = " & Clng(Session("InstructorID")) & ";"
Set InstructorSectionRecordSet = Server.CreateObject("ADODB.Connection")
InstructorSectionRecordSet.Open SqlQuery2,Connection,3,3
If Request("Submit") = "Submit" Then
'Nothing yet
Else
'Finish displaying the page
End If
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Add a Lesson</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#0000FF" alink="#FF0000">
<div align="center">Add a Lesson to a Section<br>
<br>
<form name="form1" method="post" action="AddLesson.asp">
<table width="60%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%">Lesson</td>
<td width="85%">
<select size="3" name="lessons" multiple>
<option></option>
<% LessonNameRecordSet.MoveFirst %>
<% Do Until LessonNameRecordSet.EOF %>
<option value='<% LessonNameRecordSet("LessonID") %>'><% LessonNameRecordSet("LessonID") %></option>
<% LessonNameRecordSet.MoveNext %>
<% Loop %> </select></td>
</tr>
<tr>
<td width="15%">Sections</td>
<td width="85%"> </td>
</tr>
</table>
</form>
</div>
</body>
</html>
------------------
(\__/) See the bunny.
(='.'=) Hear the bunny.
(") (") Pet the bunny.
BE the bunny.
God damnit, better graphics != revolutionary gaming! Get it through your skull!
-
Reef Shark
If you need anymore info just tell me, I'd be happy to provide.
------------------
(\__/) See the bunny.
(='.'=) Hear the bunny.
(") (") Pet the bunny.
BE the bunny.
God damnit, better graphics != revolutionary gaming! Get it through your skull!
-
You're using the wrong cursor type, can't use movefirst with a static cursor.
------------------
"My other car is also a Porsche"
-------------------------
Abit BH6, rev. 1.01
PIII-750@931
256MB PC133 Crucial RAM
Hercules Prophet 4500
Diamond Monster MX300 w. Vortex 2 v.2048 drivers
DirectX 8.0a
"My other car is also a Porsche"
-------------------------
PIV-3.0GHz, 800MHz FSB; 1GB 400MHz SDRAM; Ati Radeon 9800 Pro; SB Audigy 2; Windows XP SP1
Old rig: Abit BH6, rev. 1.01; PIII-750@931; 256MB PC133 Crucial RAM; Hercules Prophet 4500; Diamond Monster MX300; DirectX 8.0a; 60 GB IBM Deskstar 60XP
-
Reef Shark
I am assuming you mean to change the LessonNameRecordSet cursor settings to AdOPenDynamic and AddLockOptimisitic, which I have done, except it still is malfunctioning. Please bear with me, I am still new to ASP and SQL.
------------------
(\__/) See the bunny.
(='.'=) Hear the bunny.
(") (") Pet the bunny.
BE the bunny.
God damnit, better graphics != revolutionary gaming! Get it through your skull!
-
Gah, it's the small things that'll do you in any time. Instead of:
<OPTION VALUE='<% LessonRecordSet("whatever") %>'><% LessonRecordSet("whatever") %></OPTION>
You have to response.write (or <%=) those rs values, like this:
<OPTION VALUE='<%= LessonRecordSet("whatever") %>'><%= LessonRecordSet("whatever") %></OPTION>
Oh, Access doesn't use Dynamic cursors, if you set it to Dynamic, it'll automatically change to Keyset.
Originally posted by Pestilence:
I am assuming you mean to change the LessonNameRecordSet cursor settings to AdOPenDynamic and AddLockOptimisitic, which I have done, except it still is malfunctioning. Please bear with me, I am still new to ASP and SQL.
------------------
"My other car is also a Porsche"
-------------------------
Abit BH6, rev. 1.01
PIII-750@931
256MB PC133 Crucial RAM
Hercules Prophet 4500
Diamond Monster MX300 w. Vortex 2 v.2048 drivers
DirectX 8.0a
"My other car is also a Porsche"
-------------------------
PIV-3.0GHz, 800MHz FSB; 1GB 400MHz SDRAM; Ati Radeon 9800 Pro; SB Audigy 2; Windows XP SP1
Old rig: Abit BH6, rev. 1.01; PIII-750@931; 256MB PC133 Crucial RAM; Hercules Prophet 4500; Diamond Monster MX300; DirectX 8.0a; 60 GB IBM Deskstar 60XP
-
Hammerhead Shark
-
Mako Shark
Set InstructorSectionRecordSet = Server.CreateObject("ADODB.Connection")
I'm also kinda new to ASP and SQL so i'm wonder why are you using ADODB.Connection for recordset? why not use ADODB.RecordSet??
------------------
So easy to use, no wonder it's number one!!!
Where do you want to go today?
Member of NT Jocks
Tesla coils are not weapons
-
Reef Shark
Originally posted by dighn:
Set InstructorSectionRecordSet = Server.CreateObject("ADODB.Connection")
I'm also kinda new to ASP and SQL so i'm wonder why are you using ADODB.Connection for recordset? why not use ADODB.RecordSet??
As it turns out that is another error of mine. It indeed should be ADODB.RecordSet. I didn't get a chance to put up a post about it b/c I left work for the day and I don't like to think about work until the next work day actually starts. 
So far I did fix the fact that I am opening a RecordSet now and I put a = Sign in front of my statement to print to the page. However, I don't seem to be actually getting any records unfortunately. I even modified the query temporarily to be very general. There are records in there, of that I am sure. BUT, I am getting nothing in the record set. yet datasheet view in access will give me the appropriate recordset. Sounds like more fun and games for me...
------------------
(\__/) See the bunny.
(='.'=) Hear the bunny.
(") (") Pet the bunny.
BE the bunny.
God damnit, better graphics != revolutionary gaming! Get it through your skull!
-
Reef Shark
I found out what my RecordSet problem was if anyone is curious. Instead of opening the record set with the AdOpenDynamic and AdLockOptimisitc parameters I used 3,3.
------------------
(\__/) See the bunny.
(='.'=) Hear the bunny.
(") (") Pet the bunny.
BE the bunny.
[This message has been edited by Pestilence (edited July 19, 2001).]
God damnit, better graphics != revolutionary gaming! Get it through your skull!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|