|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 %> |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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) |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > whats the problem with this code? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|