p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: 0x800A01A8 - Object required: ''


Message #1 by "tsivas" <tsivas@o...> on Wed, 5 Dec 2001 00:51:57
Hi all,

I'm building a web site that has to do with e-learning. 

I'm trying to do an enroll/drop page that shows the courses  that a 

current student can enroll or drop,but I'm getting this error that says an 

object required. Can anyone help with this? What am I doing wrong?



Here's the code:

<%

set RSCourses = conn.execute("SELECT CourseID, Name, Description FROM  

Courses")	

set RSActiveCourses = conn.execute("SELECT StudentCourses.StudentID, " & _

	  "StudentCourses.Status, StudentCourses.CourseID, Courses.Name " 

&_	

	     "FROM StudentCourses INNER JOIN Courses ON "  &_	

	     "StudentCourses.CourseID = Courses.CourseID "  &_	

	   "WHERE (StudentCourses.StudentID = " & Session("StudentID")  &_

	

	    " AND StudentCourses.Status = 'InProgress')")	

	end if	

	%>	



Here's the error:

Error Type:

Microsoft VBScript runtime (0x800A01A8)

Object required: "

/OnLineCampus/enrolldrop.asp, line 39





P.S.  Line 39 is the first line of the code here.



Thank you!
Message #2 by David Cameron <dcameron@i...> on Wed, 5 Dec 2001 11:52:33 +1100
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C17D27.202D8E1C

Content-Type: text/plain



Try creating the recordset object before you open it.



eg

Set RSCourses = Server.CreateObject("ADODB.Recordset")



Also it is more normal to use the .Open method of the recordset:



eg

RSCourses.Open "SELECT CourseID, Name, Description FROM Courses", cn,

adOpenForwardOnly, adLockReadOnly



make sure that you have adovbs.inc included in the page.



regards

David Cameron

nOw.b2b

dcameron@i...



-----Original Message-----

From: tsivas [mailto:tsivas@o...]

Sent: Wednesday, 5 December 2001 10:52 AM

To: ASP Databases

Subject: [asp_databases] 0x800A01A8 - Object required: ''





Hi all,

I'm building a web site that has to do with e-learning. 

I'm trying to do an enroll/drop page that shows the courses  that a 

current student can enroll or drop,but I'm getting this error that says an 

object required. Can anyone help with this? What am I doing wrong?



Here's the code:

<%

set RSCourses = conn.execute("SELECT CourseID, Name, Description FROM  

Courses")	

set RSActiveCourses = conn.execute("SELECT StudentCourses.StudentID, " & _

	  "StudentCourses.Status, StudentCourses.CourseID, Courses.Name " 

&_	

	     "FROM StudentCourses INNER JOIN Courses ON "  &_	

	     "StudentCourses.CourseID = Courses.CourseID "  &_	

	   "WHERE (StudentCourses.StudentID = " & Session("StudentID")  &_

	

	    " AND StudentCourses.Status = 'InProgress')")	

	end if	

	%>	



Here's the error:

Error Type:

Microsoft VBScript runtime (0x800A01A8)

Object required: "

/OnLineCampus/enrolldrop.asp, line 39





P.S.  Line 39 is the first line of the code here.



Thank you!

 




$subst('Email.Unsub')




Message #3 by "tsivas" <tsivas@o...> on Wed, 5 Dec 2001 01:15:49
First of all thanks for your direct response.

I made the changes you suggested but it still doesn't work. :(

This time I get this error: 

"ADODB.Recordset error '800a0bb9' 

Arguments are of the wrong type, are out of acceptable range, or are in 

conflict with one another" 

Can you or anyone else help with this?



Thanks a lot!

--tsivas







> This message is in MIME format. Since your mail reader does not 

understand

> this format, some or all of this message may not be legible.

> 

> ------_=_NextPart_001_01C17D27.202D8E1C

> Content-Type: text/plain

> 

> Try creating the recordset object before you open it.

> 

> eg

> Set RSCourses = Server.CreateObject("ADODB.Recordset")

> 

> Also it is more normal to use the .Open method of the recordset:

> 

> eg

> RSCourses.Open "SELECT CourseID, Name, Description FROM Courses", cn,

> adOpenForwardOnly, adLockReadOnly

> 

> make sure that you have adovbs.inc included in the page.

> 

> regards

> David Cameron

> nOw.b2b

> dcameron@i...

> 

> -----Original Message-----

> From: tsivas [mailto:tsivas@o...]

> Sent: Wednesday, 5 December 2001 10:52 AM

> To: ASP Databases

> Subject: [asp_databases] 0x800A01A8 - Object required: ''

> 

> 

> Hi all,

> I'm building a web site that has to do with e-learning. 

> I'm trying to do an enroll/drop page that shows the courses  that a 

> current student can enroll or drop,but I'm getting this error that says 

an 

> object required. Can anyone help with this? What am I doing wrong?

> 

> Here's the code:

> <%

> set RSCourses = conn.execute("SELECT CourseID, Name, Description FROM  

> Courses")	

> set RSActiveCourses = conn.execute("SELECT StudentCourses.StudentID, " & 

_

> 	  "StudentCourses.Status, StudentCourses.CourseID, Courses.Name " 

> &_	

> 	     "FROM StudentCourses INNER JOIN Courses ON "  &_	

> 	     "StudentCourses.CourseID = Courses.CourseID "  &_	

> 	   "WHERE (StudentCourses.StudentID = " & Session("StudentID")  &_

> 	

> 	    " AND StudentCourses.Status = 'InProgress')")	

> 	end if	

> 	%>	

> 

> Here's the error:

> Error Type:

> Microsoft VBScript runtime (0x800A01A8)

> Object required: "

> /OnLineCampus/enrolldrop.asp, line 39

> 

> 

> P.S.  Line 39 is the first line of the code here.

> 

> Thank you!

>  




> $subst('Email.Unsub')

> 

> ------_=_NextPart_001_01C17D27.202D8E1C

> Content-Type: text/html

> Content-Transfer-Encoding: quoted-printable

> 

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

> <HTML>

> <HEAD>

> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; 

> charset=3DUS-ASCII">

> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 

> 5.5.2650.12">

> <TITLE>RE: [asp_databases] 0x800A01A8 - Object required: ''</TITLE>

> </HEAD>

> <BODY>

> 

> <P><FONT SIZE=3D2>Try creating the recordset object before you open 

> it.</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>eg</FONT>

> <BR><FONT SIZE=3D2>Set RSCourses =3D 

> Server.CreateObject(&quot;ADODB.Recordset&quot;)</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>Also it is more normal to use the .Open method of the 

> recordset:</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>eg</FONT>

> <BR><FONT SIZE=3D2>RSCourses.Open &quot;SELECT CourseID, Name, 

> Description FROM Courses&quot;, cn, adOpenForwardOnly, 

> adLockReadOnly</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>make sure that you have adovbs.inc included in the 

> page.</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>regards</FONT>

> <BR><FONT SIZE=3D2>David Cameron</FONT>

> <BR><FONT SIZE=3D2>nOw.b2b</FONT>

> <BR><FONT SIZE=3D2>dcameron@i...</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>-----Original Message-----</FONT>

> <BR><FONT SIZE=3D2>From: tsivas [<A 

> HREF=3D"mailto:tsivas@o...">mailto:tsivas@o...</A>]</FONT>

> <BR><FONT SIZE=3D2>Sent: Wednesday, 5 December 2001 10:52 AM</FONT>

> <BR><FONT SIZE=3D2>To: ASP Databases</FONT>

> <BR><FONT SIZE=3D2>Subject: [asp_databases] 0x800A01A8 - Object 

> required: ''</FONT>

> </P>

> <BR>

> 

> <P><FONT SIZE=3D2>Hi all,</FONT>

> <BR><FONT SIZE=3D2>I'm building a web site that has to do with 

> e-learning. </FONT>

> <BR><FONT SIZE=3D2>I'm trying to do an enroll/drop page that shows the 

> courses&nbsp; that a </FONT>

> <BR><FONT SIZE=3D2>current student can enroll or drop,but I'm getting 

> this error that says an </FONT>

> <BR><FONT SIZE=3D2>object required. Can anyone help with this? What am 

> I doing wrong?</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>Here's the code:</FONT>

> <BR><FONT SIZE=3D2>&lt;%</FONT>

> <BR><FONT SIZE=3D2>set RSCourses =3D conn.execute(&quot;SELECT 

> CourseID, Name, Description FROM&nbsp; </FONT>

> <BR><FONT SIZE=3D2>Courses&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

> </FONT>

> <BR><FONT SIZE=3D2>set RSActiveCourses =3D conn.execute(&quot;SELECT 

> StudentCourses.StudentID, &quot; &amp; _</FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>&nbsp; 

> &quot;StudentCourses.Status, StudentCourses.CourseID, Courses.Name 

> &quot; </FONT>

> <BR><FONT SIZE=3D2>&amp;_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; &quot;FROM StudentCourses INNER JOIN 

> Courses ON &quot;&nbsp; &amp;_&nbsp;&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; &quot;StudentCourses.CourseID =3D 

> Courses.CourseID &quot;&nbsp; &amp;_&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>&nbsp;&nbsp; &quot;WHERE (StudentCourses.StudentID =3D &quot; 

> &amp; Session(&quot;StudentID&quot;)&nbsp; &amp;_</FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>&nbsp;&nbsp;&nbsp; &quot; AND StudentCourses.Status =3D 

> 'InProgress')&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>end 

> if&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>%&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>

> </P>

> 

> <P><FONT SIZE=3D2>Here's the error:</FONT>

> <BR><FONT SIZE=3D2>Error Type:</FONT>

> <BR><FONT SIZE=3D2>Microsoft VBScript runtime (0x800A01A8)</FONT>

> <BR><FONT SIZE=3D2>Object required: &quot;</FONT>

> <BR><FONT SIZE=3D2>/OnLineCampus/enrolldrop.asp, line 39</FONT>

> </P>

> <BR>

> 

> <P><FONT SIZE=3D2>P.S.&nbsp; Line 39 is the first line of the code 

> here.</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>Thank you!</FONT>

> <BR><FONT SIZE=3D2>&nbsp;</FONT>

> <BR><FONT SIZE=3D2>---</FONT>

> <BR><FONT SIZE=3D2>

> dcameron@i...</FONT>

> <BR><FONT SIZE=3D2>

> $subst('Email.Unsub')</FONT>

> </P>

> 

> </BODY>

> </HTML>

> ------_=_NextPart_001_01C17D27.202D8E1C--

Message #4 by David Cameron <dcameron@i...> on Wed, 5 Dec 2001 12:12:50 +1100
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C17D29.F57DF1CC

Content-Type: text/plain



Post the code that is causing the problem.



regards

David Cameron

nOw.b2b

dcameron@i...



-----Original Message-----

From: tsivas [mailto:tsivas@o...]

Sent: Wednesday, 5 December 2001 11:16 AM

To: ASP Databases

Subject: [asp_databases] RE: 0x800A01A8 - Object required: ''





First of all thanks for your direct response.

I made the changes you suggested but it still doesn't work. :(

This time I get this error: 

"ADODB.Recordset error '800a0bb9' 

Arguments are of the wrong type, are out of acceptable range, or are in 

conflict with one another" 

Can you or anyone else help with this?



Thanks a lot!

--tsivas







> This message is in MIME format. Since your mail reader does not 

understand

> this format, some or all of this message may not be legible.

> 

> ------_=_NextPart_001_01C17D27.202D8E1C

> Content-Type: text/plain

> 

> Try creating the recordset object before you open it.

> 

> eg

> Set RSCourses = Server.CreateObject("ADODB.Recordset")

> 

> Also it is more normal to use the .Open method of the recordset:

> 

> eg

> RSCourses.Open "SELECT CourseID, Name, Description FROM Courses", cn,

> adOpenForwardOnly, adLockReadOnly

> 

> make sure that you have adovbs.inc included in the page.

> 

> regards

> David Cameron

> nOw.b2b

> dcameron@i...

> 

> -----Original Message-----

> From: tsivas [mailto:tsivas@o...]

> Sent: Wednesday, 5 December 2001 10:52 AM

> To: ASP Databases

> Subject: [asp_databases] 0x800A01A8 - Object required: ''

> 

> 

> Hi all,

> I'm building a web site that has to do with e-learning. 

> I'm trying to do an enroll/drop page that shows the courses  that a 

> current student can enroll or drop,but I'm getting this error that says 

an 

> object required. Can anyone help with this? What am I doing wrong?

> 

> Here's the code:

> <%

> set RSCourses = conn.execute("SELECT CourseID, Name, Description FROM  

> Courses")	

> set RSActiveCourses = conn.execute("SELECT StudentCourses.StudentID, " & 

_

> 	  "StudentCourses.Status, StudentCourses.CourseID, Courses.Name " 

> &_	

> 	     "FROM StudentCourses INNER JOIN Courses ON "  &_	

> 	     "StudentCourses.CourseID = Courses.CourseID "  &_	

> 	   "WHERE (StudentCourses.StudentID = " & Session("StudentID")  &_

> 	

> 	    " AND StudentCourses.Status = 'InProgress')")	

> 	end if	

> 	%>	

> 

> Here's the error:

> Error Type:

> Microsoft VBScript runtime (0x800A01A8)

> Object required: "

> /OnLineCampus/enrolldrop.asp, line 39

> 

> 

> P.S.  Line 39 is the first line of the code here.

> 

> Thank you!

>  




> $subst('Email.Unsub')

> 

> ------_=_NextPart_001_01C17D27.202D8E1C

> Content-Type: text/html

> Content-Transfer-Encoding: quoted-printable

> 

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

> <HTML>

> <HEAD>

> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; 

> charset=3DUS-ASCII">

> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 

> 5.5.2650.12">

> <TITLE>RE: [asp_databases] 0x800A01A8 - Object required: ''</TITLE>

> </HEAD>

> <BODY>

> 

> <P><FONT SIZE=3D2>Try creating the recordset object before you open 

> it.</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>eg</FONT>

> <BR><FONT SIZE=3D2>Set RSCourses =3D 

> Server.CreateObject(&quot;ADODB.Recordset&quot;)</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>Also it is more normal to use the .Open method of the 

> recordset:</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>eg</FONT>

> <BR><FONT SIZE=3D2>RSCourses.Open &quot;SELECT CourseID, Name, 

> Description FROM Courses&quot;, cn, adOpenForwardOnly, 

> adLockReadOnly</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>make sure that you have adovbs.inc included in the 

> page.</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>regards</FONT>

> <BR><FONT SIZE=3D2>David Cameron</FONT>

> <BR><FONT SIZE=3D2>nOw.b2b</FONT>

> <BR><FONT SIZE=3D2>dcameron@i...</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>-----Original Message-----</FONT>

> <BR><FONT SIZE=3D2>From: tsivas [<A 

> HREF=3D"mailto:tsivas@o...">mailto:tsivas@o...</A>]</FONT>

> <BR><FONT SIZE=3D2>Sent: Wednesday, 5 December 2001 10:52 AM</FONT>

> <BR><FONT SIZE=3D2>To: ASP Databases</FONT>

> <BR><FONT SIZE=3D2>Subject: [asp_databases] 0x800A01A8 - Object 

> required: ''</FONT>

> </P>

> <BR>

> 

> <P><FONT SIZE=3D2>Hi all,</FONT>

> <BR><FONT SIZE=3D2>I'm building a web site that has to do with 

> e-learning. </FONT>

> <BR><FONT SIZE=3D2>I'm trying to do an enroll/drop page that shows the 

> courses&nbsp; that a </FONT>

> <BR><FONT SIZE=3D2>current student can enroll or drop,but I'm getting 

> this error that says an </FONT>

> <BR><FONT SIZE=3D2>object required. Can anyone help with this? What am 

> I doing wrong?</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>Here's the code:</FONT>

> <BR><FONT SIZE=3D2>&lt;%</FONT>

> <BR><FONT SIZE=3D2>set RSCourses =3D conn.execute(&quot;SELECT 

> CourseID, Name, Description FROM&nbsp; </FONT>

> <BR><FONT SIZE=3D2>Courses&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

> </FONT>

> <BR><FONT SIZE=3D2>set RSActiveCourses =3D conn.execute(&quot;SELECT 

> StudentCourses.StudentID, &quot; &amp; _</FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>&nbsp; 

> &quot;StudentCourses.Status, StudentCourses.CourseID, Courses.Name 

> &quot; </FONT>

> <BR><FONT SIZE=3D2>&amp;_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; &quot;FROM StudentCourses INNER JOIN 

> Courses ON &quot;&nbsp; &amp;_&nbsp;&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; &quot;StudentCourses.CourseID =3D 

> Courses.CourseID &quot;&nbsp; &amp;_&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>&nbsp;&nbsp; &quot;WHERE (StudentCourses.StudentID =3D &quot; 

> &amp; Session(&quot;StudentID&quot;)&nbsp; &amp;_</FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>&nbsp;&nbsp;&nbsp; &quot; AND StudentCourses.Status =3D 

> 'InProgress')&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>end 

> if&nbsp; </FONT>

> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 

> SIZE=3D2>%&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>

> </P>

> 

> <P><FONT SIZE=3D2>Here's the error:</FONT>

> <BR><FONT SIZE=3D2>Error Type:</FONT>

> <BR><FONT SIZE=3D2>Microsoft VBScript runtime (0x800A01A8)</FONT>

> <BR><FONT SIZE=3D2>Object required: &quot;</FONT>

> <BR><FONT SIZE=3D2>/OnLineCampus/enrolldrop.asp, line 39</FONT>

> </P>

> <BR>

> 

> <P><FONT SIZE=3D2>P.S.&nbsp; Line 39 is the first line of the code 

> here.</FONT>

> </P>

> 

> <P><FONT SIZE=3D2>Thank you!</FONT>

> <BR><FONT SIZE=3D2>&nbsp;</FONT>

> <BR><FONT SIZE=3D2>---</FONT>

> <BR><FONT SIZE=3D2>

> dcameron@i...</FONT>

> <BR><FONT SIZE=3D2>

> $subst('Email.Unsub')</FONT>

> </P>

> 

> 

 <BR>

---<BR>

You are currently subscribed to asp_databases as: dcameron@i...<BR>


$subst('Email.Unsub')<BR>



</BODY>

> </HTML>

> ------_=_NextPart_001_01C17D27.202D8E1C--




Message #5 by "tsivas" <tsivas@o...> on Wed, 5 Dec 2001 01:23:24
Thanks for your help! 

Here's the code: 



<% if not isempty(Request.QueryString("CourseID")) then	

	  'wants to enroll in course

	Dim strconn

	Dim strSQL

	Dim conn

	Dim cnn

	

	conn = "Provider=Microsoft.Jet.OLEDB.4.0;"  &_

                                "Data Source=C:\Inetpub\wwwroot\ptixiaki2

\db\dbdistant.mdb;"  &_

								"Persist 

Security Info=False"

	

	  Set cnn = Server.CreateObject("ADODB.Connection")

	  cnn.Open conn

	  							

	  set RSCourseInProgress = conn.execute ("SELECT StudentCourseID " 

& " from StudentCourses WHERE StudentID = "  & _	

	   session("StudentID") & " and CourseID = " & _	

	   Request.QueryString("CourseID") & " and Status = 'InProgress'")

	   	

	  if RSCourseInProgress.EOF then

	     	strSQL= "INSERT INTO StudentCourses(StudentID, CourseID, 

Status, StatusDate)	 VALUES ('" & Session("StudentID") & ", " & _	

	        Request.QueryString("CourseID") & "', 'InProgress', '" & 

Date & "')"

	        cnn.Execute strSQL, , adCmdText  + 

adExecuteNoRecords                                                   	

	  end if	

	              Response.Redirect "student_menudistant.asp"	

	elseif not isempty(Request.Form("CourseToDrop")) then	

	                      'want to drop a course	

	 	  set RSActiveCourses = conn.execute ("DELETE FROM 

StudentCourses WHERE StudentID = " & session("StudentID") & " and CourseID 

= " & Request.Form("CourseToDrop") & " and Status = 'InProgress'")	

	  Response.Redirect "student_menudistant.asp"	

	else

	 Set RSCourses = Server.CreateObject("ADODB.Recordset")	

	   RSCourses.Open "SELECT CourseID, Name, Description FROM 

Courses", conn,adOpenForwardOnly, adLockReadOnly

	 

  	  set RSActiveCourses = conn.execute("SELECT 

StudentCourses.StudentID, " & _ "StudentCourses.Status, 

StudentCourses.CourseID, Courses.Name " &_	

	     "FROM StudentCourses INNER JOIN Courses ON "  &_	

	     "StudentCourses.CourseID = Courses.CourseID "  &_	

	   "WHERE (StudentCourses.StudentID = " & Session("StudentID")  &_

	

	    " AND StudentCourses.Status = 'InProgress')")	

	end if	

	%>	

Message #6 by David Cameron <dcameron@i...> on Wed, 5 Dec 2001 12:24:35 +1100
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C17D2B.9990A506

Content-Type: text/plain



I did say at the bottom of my email to make sure that you include the file

adovbs.inc in the page, which it appears you haven't done. Either include

adovbs.inc or change the line to:



RSCourses.Open "SELECT CourseID, Name, Description FROM Courses", conn



The second option will work but is *not* recommended.



I recommend that you use the .Open method to open all your recordsets.



This link might also be of interest:

http://www.adopenstatic.com/faq/800a0bb9.asp



regards

David Cameron

nOw.b2b

dcameron@i...




Message #7 by "Tomm Matthis" <matthis@b...> on Wed, 5 Dec 2001 11:51:29 -0500
Have you dimmed the RSCourses explictly before assigning them? Also, setup the

SQL strings in a var outside of the conn.execute statement... and then do a

response.write to see that they are concatenated correctly.



HTHs,



Tomm



> -----Original Message-----

> From: tsivas [mailto:tsivas@o...]

> Sent: Wednesday, December 05, 2001 12:52 AM

> To: ASP Databases

> Subject: [asp_databases] 0x800A01A8 - Object required: ''

>

>

> Hi all,

> I'm building a web site that has to do with e-learning.

> I'm trying to do an enroll/drop page that shows the courses  that a

> current student can enroll or drop,but I'm getting this error that says an

> object required. Can anyone help with this? What am I doing wrong?

>

> Here's the code:

> <%

> set RSCourses = conn.execute("SELECT CourseID, Name, Description FROM

> Courses")

> set RSActiveCourses = conn.execute("SELECT StudentCourses.StudentID, " & _

> 	  "StudentCourses.Status, StudentCourses.CourseID, Courses.Name "

> &_

> 	     "FROM StudentCourses INNER JOIN Courses ON "  &_

> 	     "StudentCourses.CourseID = Courses.CourseID "  &_

> 	   "WHERE (StudentCourses.StudentID = " & Session("StudentID")  &_

>

> 	    " AND StudentCourses.Status = 'InProgress')")

> 	end if

> 	%>

>

> Here's the error:

> Error Type:

> Microsoft VBScript runtime (0x800A01A8)

> Object required: "

> /OnLineCampus/enrolldrop.asp, line 39

>

>

> P.S.  Line 39 is the first line of the code here.

>

> Thank you!

>




> $subst('Email.Unsub')

>




  Return to Index