צפיות
תשובות
בעיה בקליטת נתונים!
שלום !
רציתי לשאול מה הבעיה בטופס הבא שמופיע לי ההודעה הבה כאשר הנתונים נשלחים למערכת
הקוד!
<%@ Language=VBScript codepage=1255%>
<%
dim uName,rsStr ,myStr,srte
Set conn = Server.CreateObject("ADODB.Connection")
uName= Request.Form("Uname")
Conn.Open ("DATA")
Set rs = Server.CreateObject("ADODB.Recordset")
rsStr = "SELECT Uname FROM People "
rsStr = "SELECT Uname FROM People WHERE Uname='"&uName&"'"
rs.Open rsStr,conn
if uName = rs("Uname") then
rs.Close
set rs = nothing
conn.Close
set conn = nothing
myStr = "שם המשתמש תפוס"
%>
<html>
<head>
<title>ארעה שגיאה בהרשמה למערכת</title>
</head>
<body bgcolor=#99ccff>
<P align=right><FONT ><A href="index.asp"><IMG id=IMG1 src="picture/shmuel.gif" align=right border=0></A> </FONT></P>
<center>
<P> ארעה שגיאה בהרשמה למערכת, הנתון/ים השגויים הם:</P>
<font color="red"><%=myStr%></font>
לחץ <a href="javascript:history.back()">כאן</a> ע"מ לנסות שנית
</center>
</body>
</html>
<%
elseif uName <> rs("Uname") then
rs.Close
set rs = nothing
myStr = "!ההרשמה התבצעה בהצלחה"
stre="login.asp"
sqlText= "INSERT INTO People (Uname,uPass,NAME,Lastname,CODEUSER,address,CITY,zipcode,phone,cellular,email)"
sqlText=sqlText & " values ('" & Request.form("Uname") & "','"
sqlText=sqlText & Request.form("uPass") & "','"
sqlText=sqlText & Request.form("NAME") & "','"
sqlText=sqlText & Request.form("Lastname") & "','"
sqlText=sqlText & Request.form("CODEUSER") & "','"
sqlText=sqlText & Request.form("address") & "','"
sqlText=sqlText & Request.form("CITY") & "','"
sqlText=sqlText & Request.form("zipcode") & "','"
sqlText=sqlText & Request.form("phone") & "','"
sqlText=sqlText & Request.form("cellular") & "','"
sqlText=sqlText & Request.form("email") &"')"
conn.Execute sqlText
conn.Close
set conn = nothing
%>
<html>
<head>
</HEAD>
<BODY bgcolor=#99ccff LANGUAGE=javascript onerror="return window_onerror()">
<P align=right><IMG src="picture/shmuel.gif"
align=right> </P>
<P align=right> </P>
<P align=right> </P>
<P align=center> </P>
<P align=center> </P>
<P align=center><STRONG><FONT size=5></FONT></STRONG> </P>
<P align=center><FONT size=5><%=myStr%></P>
<STRONG> <P align=center>!לחץ
<A href="<%=stre%>"><FONT size=5><STRONG>כאן</STRONG></FONT></A><FONT
size=5><STRONG> לכניסה
&l
5 תשובות
המשך
</STRONG><STRONG>למערכת</STRONG></FONT> </P></BODY></HTML>
<%end if%>
הודעת השגיאה
Error Type:
(0x80020009)
Exception occurred.
/adduser.asp, line 15
שורה 15
if uName = rs("Uname") then
תודה מראש
א.ר.ר
תנסה ככה
<%@ Language=VBScript codepage=1255%>
<%
dim uName,rsStr ,myStr,srte
Set conn = Server.CreateObject("ADODB.Connection")
uName= Request.Form("Uname")
Conn.Open("DATA")
Set rs = Server.CreateObject("ADODB.Recordset")
rsStr = "SELECT Uname FROM People WHERE Uname='"&uName&"'"
rs.Open rsStr,con,0,1
If Not rs.eof then
myStr = "שם המשתמש תפוס"
%>
<html>
<head>
<title>ארעה שגיאה בהרשמה למערכת</title>
</head>
<body bgcolor=#99ccff>
<P align=right><FONT ><A href="index.asp"><IMG id=IMG1 src="picture/shmuel.gif" align=right border=0></A> </FONT></P>
<center>
<P> ארעה שגיאה בהרשמה למערכת, הנתון/ים השגויים הם:</P>
<font color="red"><%=myStr%></font>
לחץ <a href="javascript:history.back()">כאן</a> ע"מ לנסות שנית
</center>
</body>
</html>
<%
else
myStr = "!ההרשמה התבצעה בהצלחה"
stre="login.asp"
sqlText= "INSERT INTO People (Uname,uPass,NAME,Lastname,CODEUSER,address,CITY,zipcode,phone,cellular,email)"
sqlText=sqlText & " values ('" & Request.form("Uname") & "','"
sqlText=sqlText & Request.form("uPass") & "','"
sqlText=sqlText & Request.form("NAME") & "','"
sqlText=sqlText & Request.form("Lastname") & "','"
sqlText=sqlText & Request.form("CODEUSER") & "','"
sqlText=sqlText & Request.form("address") & "','"
sqlText=sqlText & Request.form("CITY") & "','"
sqlText=sqlText & Request.form("zipcode") & "','"
sqlText=sqlText & Request.form("phone") & "','"
sqlText=sqlText & Request.form("cellular") & "','"
sqlText=sqlText & Request.form("email") &"')"
conn.Execute sqlText
conn.Close
set conn = nothing
%>
<html>
<head>
</HEAD>
<BODY bgcolor=#99ccff LANGUAGE=javascript onerror="return window_onerror()">
<P align=right><IMG src="picture/shmuel.gif"
align=right> </P>
<P align=right> </P>
<P align=right> </P>
<P align=center> </P>
<P align=center> </P>
<P align=center><STRONG><FONT size=5></FONT></STRONG> </P>
<P align=center><FONT size=5><%=myStr%></P>
<STRONG> <P align=center>!לחץ
<A href="<%=stre%>"><FONT size=5><STRONG>כאן</STRONG></FONT></A><FONT
size=5><STRONG> לכניסה
</STRONG><STRONG>למערכת</STRONG></FONT> </P></BODY></HTML>
<%end if%>
עכשיו מופיע לי
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/adduser.asp, line 12
הקוד בשורה 12
rs.Open rsStr,con,0,1
א.ר.ר
שחכתי n
חח טעות שלי תחליף את השורה הזאת
rs.Open rsStr,con,0,1
בזאת:
rs.Open rsStr,conn,0,1
תודה רבה!
א.ר.ר