ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 5th, 2003, 03:32 PM
anav123 anav123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 17 anav123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
whats the problem with this code?

why does the error:

Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/f_main.asp, line 30
endif

appear after running this code:

<%

set c=Server.CreateObject("ADODB.connection")
set r=Server.CreateObject("ADODB.recordset")

c.Open "DBQ= " & server.MapPath ("forum.mdb")& "; Driver={Microsoft Access Driver (*.mdb)};"
r.CursorType=adOpenKeyset
r.LockType=adLockOptimistic
r.open "member", c,3,3

set check=0
set a=Request.form("text1")
set b=Request.form("password1")
set c=Request.form("text2")

if r.BOF=true and r.EOF=true then
msgbox "user does not exist"
else r.MoveFirst
while r.BOF=false or r.EOF=false
if((r("userid")<>a) and (r("password")<>b) and (r("email")<>c)) then
set check=1 '(line 30)
endif
r.MoveNext
wend
endif

if check=1 then
msgbox "user does not exist"
endif

r.Close
set r=nothing
c.Close
set c=nothing
%>

Reply With Quote
  #2  
Old September 5th, 2003, 04:23 PM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
Code:
Error Type: 
Microsoft VBScript compilation (0x800A0400) 
Expected statement 
/f_main.asp, line 30 
endif

that is your answer right there. it shouldn't be endif. it should be end if. also, you do not use Set with primitive data types. i.e.
Code:
set check=0 
set a=Request.form("text1") 
set b=Request.form("password1") 
set c=Request.form("text2")
' would simply be
check=0 
a=Request.form("text1") 
b=Request.form("password1") 
c=Request.form("text2")

Set is used for objects and referencing them.

if you would like to to learn more about the set command here is a simple tutorial:
http://www.programmerscorner.com/tu...Set_Command.php
__________________
Programmer's Corner

Reply With Quote
  #3  
Old September 5th, 2003, 05:35 PM
anav123 anav123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 17 anav123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thax, it helped.
but now i have another error:

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'c'
/f_main.asp, line 41

c.close (line 41)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > whats the problem with this code?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT