Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: RE: IMPORTANT Connection error


Message #1 by "Larry Woods" <larry@l...> on Mon, 18 Nov 2002 19:13:51 -0700
My apologies!!!!  I reviewed your note again...and I TOTALLY
missed the part at the end.

Again, I apologize.

Larry Woods


> -----Original Message-----
> From: Steven Lloyd [mailto:steven@s...]
> Sent: Monday, November 18, 2002 6:13 PM
> To: Access ASP
> Subject: [access_asp] Connection error
>
>
> I am working through a tutorial on ASP and have an
> error which is giving me
> some grief. If somebody could please have a look at
> the following code and
> tell me where I am going wrong. It is straight out of
> the tutorial so I
> would have thought it would work.
>
> ------------------------------------------------------------
>
> <%@ LANGUAGE="VBSCRIPT" %>
> <% pageTitle = "" %>
> <!--#include virtual="/ASP_TUT/PAGETOP.TXT" -->
>
> <%
>     p_userid = Request.querystring("p-name")
>     p_pass1 = Request.querystring("p_pass1")
>     p_pass2 = Request.querystring("p_pass2")
>     p_first = Request.querystring("p_first")
>     p_last = Request.querystring("p_last")
>     p_email = Request.querystring("p_email")
>
>     set OUTPOST = Server.CreateObject("ADODB.Connection")
>
>     theSQL = "insert into members "
>     theSQL = theSQL & "(username, password,
> first_name, Last_name, "
>     theSQL = theSQL & "email, believes_in_aliens)"
>     theSQL = theSQL & " values ('"&p_userid&"',
> '"&p_pass1&"', '"
>     theSQL = theSQL & p_first&"', '"&p_last
> &"','"&p_email&"', '"
>     theSQL = theSQL & p_believes_in_aliens&"')"
>
>     OUTPOST.Execute(theSQL)
>
>     for each p_medium in Request.querystring("p_medium")
>         theSQL = "insert into userid_medium (userid,
> medium) values
> ('"&p_userid&"', '"&p_medium&"')"
>         OUTPOST.Execute(theSQL)
>     next
>
>     OUTPOST.close
>     set OUTPOST = Nothing
> %>
>
> <h2> User Registration</h2>
>
> Userid: <%= p_userid %> <br>
> Password: <%= p_pass1 %> <br>
> Password2 <%= p_pass2 %> <br>
> First Name: <%= p_first %> <br>
> Last Name: <%= p_last %> <br>
> Email: <%= p_email %> <br>
>
> <%
>     for each p_medium in request.querystring("p_medium")
> %>
>         Preferred medium: <%= p_medium %><br>
> <%
>     next
> %>
>
>
> <!--#include virtual="/ASP_TUT/pagebottom.txt"-->
> </body>
> </html>
>
> ------------------------------------------------------------
>
>
> The page is
<http://www.showpage.com.au/ASP_TUT/take_registration.asp> It is
supposed to update the database with new registrations from the
page
<http://www.showpage.com.au/ASP_TUT/register.asp> but instead
gives me the
following error.

ADODB.Connection error '800a0e78'
The operation requested by the application is not allowed if the
object is
closed.
/ASP_TUT/take_registration.asp, line 22

I guess the database is not being opened correctly but as I am a
beginner I
cannot figure it out. :-(

Thanks




  Return to Index