Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > BOOK: Beginning ASP 3.0
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 28th, 2008, 02:35 AM
Registered User
 
Join Date: Apr 2008
Location: dar es salaam, , Tanzania.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to zedekiah
Default Error Type:VBScript compilation(0x800A0401)IN DEL

:confused:


PLZZZ HELP ME I DONT KNOW WHAT TO DO NEXT
Error Type:

Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/starter/demo_delete.asp, line 8, column 59
conn.Open "D:\Inetpub\wwwroot\starter\Classified_2000.md b" cid=Request.Form("PersonID") if Request.form("familyname")="" then


IM TRYING TO DELETE RECORDS FROM A ACCESS DB BY CLICKING THE IDNO OF THE CORRESPONDING RECORDS BUT I RECEIVE THE ABOVE ERROR,AND BELOW ARE THE CODES I'M USING

################################################## #
<html>
<body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "D:\Inetpub\wwwroot\starter\Classified_2000.md b"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "SELECT * FROM Person",conn
%><h2>List Database</h2>
<table border="1" width="100%">
<tr>
<%
for each x in rs.Fields
  response.write("<th>" & ucase(x.name) & "</th>")
next
%>
</tr>
<% do until rs.EOF %>
<tr>
<form method="post" action="demo_delete.asp">
<%
for each x in rs.Fields
  if x.name="PersonID" then%>
    <td>
    <input type="submit" name="PersonID" value="<%=x.value%>">
    </td>
  <%else%>
    <td><%Response.Write(x.value)%></td>
  <%end if
next
%>
</form>
<%rs.MoveNext%>
</tr>
<%
loop
conn.close
%>
</table></body>
</html>
################################################## ##
AND THIS IS THE SECOND FORM CALLED "demo_delete.asp"

<html>
<body><h2>Delete Record</h2>
<%
dim cid

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "D:\Inetpub\wwwroot\starter\Classified_2000.md b" cid=Request.Form("PersonID") if Request.form("familyname")="" then

  set rs=Server.CreateObject("ADODB.Recordset")
  rs.open "SELECT * FROM Person WHERE PersonID='" & cid & "'",conn
  %>
  <form method="post" action="demo_delete.asp">
  <table>
  <%for each x in rs.Fields%>
  <tr>
  <td><%=x.name%></td>
  <td><input name="<%=x.name%>" value="<%=x.value%>"></td>
  <%next%>
  </tr>
  </table>
  <br /><br />
  <input type="submit" value="Delete record">
  </form>
<%
else
  sql="DELETE FROM Person"
  sql=sql & " WHERE PersonID='" & cid & "'"
  on error resume next
  conn.Execute sql
  if err<>0 then
    response.write("No update permissions!")
  else
    response.write("Record " & cid & " was deleted!")
  end if
end if
conn.close
%></body>
</html>






  #2 (permalink)  
Old June 6th, 2008, 11:08 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

You've got THREE LINES all jammed into ONE line!

conn.Open "D:\Inetpub\wwwroot\starter\Classified_2000.md b" cid=Request.Form("PersonID") if Request.form("familyname")="" then

That's not legal in VBScript. Separate them into individual lines!

conn.Open "D:\Inetpub\wwwroot\starter\Classified_2000.md b"
cid=Request.Form("PersonID")
if Request.form("familyname")="" then

In *SOME* circumstances you can put more than one statement on a line by putting a colon between statements, but I wouldn't recommend it for such use and certainly not in this case.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft VBScript compilation (0x800A0401) dayang Classic ASP Basics 14 May 8th, 2008 02:16 AM
Microsoft VBScript compilation error '800a0401' aduggan Classic ASP Databases 1 May 5th, 2007 05:31 AM
Microsoft VBScript compilation error '800a03ee' snanuwa Classic ASP Databases 3 September 7th, 2006 06:51 AM
Microsoft VBScript compilation error karlzoe Classic ASP Databases 2 December 29th, 2004 10:44 AM
Microsoft VBScript compilation error '800a0401' baistopgun BOOK: Beginning ASP 3.0 3 October 16th, 2004 12:52 PM



All times are GMT -4. The time now is 01:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.