Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
|
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 6th, 2004, 07:44 AM
Registered User
 
Join Date: Jun 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft VBScript compilation error '800a03f6'

Hi i have updated the code thx to happygv and am now getting:
Microsoft VBScript compilation error '800a03f6'

Expected 'End'

/myspace/edit_userloc.asp, line 36

this is almost there but not quite.

the edituser_loc.asp page is:

<%@ LANGUAGE="VBSCRIPT" %>
<% Response.buffer = TRUE %>



<%
if isAdmin then
   username = Request.cookies("isLoggedInAs")("username")

   town = cstr(Request.form("utown"))
   postcode = cstr(Request.form("upostcode"))
   alerts = cstr(Request.form("alerts"))
   Response.write town & "<br>"
   Response.write alerts & "<br>"
   Response.write postcode & "<br>"
   Response.write username
   set racDB = Server.CreateObject("ADODB.Connection")
   racDB.Open "rac"

   set insertset = Server.CreateObject("ADODB.RecordSet")
   insertset.Open "Select count(*) as Cnt from memb_loc where username= '" & username & "'", racdb
   Dim UserExist, strsql
   UserExist = insertset("Cnt")
   insertset.close
   set insertset = Nothing
   If CInt(UserExist)=0 then
   strsql="Insert into memb_loc(username,town,postcode,alerts) Values('" & username & "','" & town & "','" & postcode & "','" & alerts & "')"
   response.write strsql
   response.end
   racdb.Execute(strsql)
   Else
   strsql="Update memb_loc set town='" & town & "', postcode='" & postcode & "', alerts='" & alerts & "' where username='" & username & "'"
   response.write strsql
   response.end
   racdb.Execute(strsql)
   End if

%>
</BODY>
</HTML>

this is going to write the values as well as update the database.

all the variables have values so that all works.....

please help.

steve

 
Old June 6th, 2004, 11:17 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

<%@ LANGUAGE="VBSCRIPT" %>
<% Response.buffer = TRUE %>



<%
if isAdmin then
   username = Request.cookies("isLoggedInAs")("username")

   town = cstr(Request.form("utown"))
   postcode = cstr(Request.form("upostcode"))
   alerts = cstr(Request.form("alerts"))
   Response.write town & "<br>"
   Response.write alerts & "<br>"
   Response.write postcode & "<br>"
   Response.write username
   set racDB = Server.CreateObject("ADODB.Connection")
   racDB.Open "rac"

   set insertset = Server.CreateObject("ADODB.RecordSet")
   insertset.Open "Select count(*) as Cnt from memb_loc where username= '" & username & "'", racdb
   Dim UserExist, strsql
   UserExist = insertset("Cnt")
   insertset.close
   set insertset = Nothing
   If CInt(UserExist)=0 then
       strsql="Insert into memb_loc(username,town,postcode,alerts) Values('" & username & "','" & town & "','" & postcode & "','" & alerts & "')"
        response.write strsql
        response.end
        racdb.Execute(strsql)
   Else
        strsql="Update memb_loc set town='" & town & "', postcode='" & postcode & "', alerts='" & alerts & "' where username='" & username & "'"
        response.write strsql
        response.end
        racdb.Execute(strsql)
   End if
end if
%>
</BODY>
</HTML>



PLease check the above code - You have missed end if in the end.

Om Prakash
 
Old June 8th, 2004, 02:04 PM
Registered User
 
Join Date: Jun 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks this is all fixed







Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft VBScript compilation error '800a03f6' jdutwell Classic ASP Basics 3 April 2nd, 2008 01:50 PM
Microsoft VBScript compilation error '800a03f6' ksrhyd Classic ASP Professional 0 October 11th, 2007 07:53 AM
Microsoft VBScript compilation error '800a03f6' dondavanzo Access ASP 1 May 30th, 2006 02:11 PM
Microsoft VBScript compilation error '800a0408' tarzannn Classic ASP Professional 2 February 3rd, 2006 08:55 AM
Microsoft VBScript compilation error karlzoe Classic ASP Databases 2 December 29th, 2004 10:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.