![]() |
# 1 |
חבר בקהילה
|
בעיה בעידכון ועריכה ASP
זה הקוד של הדף חיפוש לפי שם
קוד:
<% if session ("adminCheck")<>"true" then response.write "כניסה למורשים בלבד!" else%> <html> <head> <title> דף הניהול </title> </head> <body dir="rtl"> <h1> דף הניהול </h1> <h2> חיפוש לפי שם פרטי </h2> <% path=server.mappath("data/db1.mdb") set con=server.createobject("ADODB.Connection") con.open "Provider=Microsoft.Jet.OLEDB.4.0;data source=" &path fname=request.form("firstname") sq="select*from personal_data where (fname='"&firstname&"')" set r=con.execute(sq) response.write "<table border width='100%'>" do until r.eof response.write "<tr>" response.write "<td>" &r.fields ("id")& "</td>" response.write "<td>" &r.fields ("fname")& "</td>" response.write "<td>" &r.fields ("sname")& "</td>" response.write "<td>" &r.fields ("gender")& "</td>" response.write "<td>" &r.fields ("passworda")& "</td>" response.write "<td>" &r.fields ("e")& "</td>" response.write "<td>" &r.fields ("nstreet")& "</td>" response.write "<td>" &r.fields ("city")& "</td>" response.write "</tr>" r.movenext loop response.write "</table>" end if %></body></html> Microsoft JET Database Engine (0x80040E10) No value given for one or more required parameters. /shirionsite/findFnme.asp, line 19 בדף העריכה זה הקוד: קוד:
<% if session("adminCheck")<>"true" then response.write "כניסה למורשים בלבד!" %> <html> <head> <title> דף הניהול </title> </head> <body dir="rtl"> <h2> ערוך משתמש </h2> <% path=Server.mappath("data/db1.mdb") set con= Server.createobject("ADODB.Connection") con.open "Provider=Microsoft.Jet.OLEDB.4.0;data source=" &path set R=con.execute(sq) sq="select*from personal_data where (id='"&id&"')" if r.eof then response.write "לא נמצאה רשומה עם מספר ת.ז המבוקש" else %> <a href="admin.asp"> <font size="-1"> לדף הניהול </font> </a> <form action="update.asp" method="post"> <table> <tr> <td> תעודת זהות: </td> <td> <input disabled value="<%=r.fields("id")%>"> </td> <input type=hidden"="id" value="<%=r.fields("id")%>"> </tr> <tr> <td> שם: </td> <td> <input name="fname" value="<%=r.fields("firstname")%>"> </td> </tr> <tr> <td> שם משפחה: </td> </td> <input name="sname" value="<%=r.fields("familyname")%>"> </td> </tr> <tr> <td colspan="2"> <input type="radio" value="זכר" name="gender" <%if r.fields("gender")="זכר" then response.write "checked"%>> זכר <input type="radio" value="נקבה" name="gender" <%if r.fields("gender")="נקבה" then response.write "checked"%>> נקבה נקבה </td> </tr> <tr> <td> דוא"ל </td> <td> <input name="email" value="<%=r.fields("email") %>"> </td> </tr> <tr> <td align="left" colspan="2"> <input type="submit" value="עדכן"> </td> </tr> </table> </form> <% end if end if %> </body> </html> איך אני מסדר את זה? תודה מראש יום טוב Last edited by typhoonil; 05-05-08 at 12:57.. |
![]() |
![]() |
# 2 |
חבר על
|
sq="select*from personal_data where (fname='"&firstname&"')"
תחליף ל sq="select * from personal_data where fname='"&firstname&"'"
__________________
דוד בן דוד. |
![]() |
![]() |
# 3 |
חבר בקהילה
|
אני עדיין מקבל את אותה שגיאה
|
![]() |
![]() |
# 4 |
Winner
|
שם לב שכבתבת בשאילתת הsql את המשתנה firstname שהוא לא קיים, תקן לfname.
__________________
להנאתם אתר משחקים כיפי. היום עושים מסיבות רווקים ורווקות רק בלופט למסיבות, תנסו ולא תתחרטו. |
![]() |
![]() |
# 5 |
חבר בקהילה
|
החיפוש כרגע עובד.
אבל כשאני נכנס לדף של העריכה עדיין מוצג לי דף ריק. ויש לי עוד דף של חיפוש לפי שם ושם משפחה: קוד:
<% if session ("adminCheck")<>"true" then response.write "כניסה למורשים בלבד!" else%> <html> <head> <title> דף הניהול </title> </head> <body dir="rtl"> <h1> דף הניהול </h1> <h2> חיפוש לפי שם פרטי </h2> <body dir="rtl"> <% fname=Request.Form("firstname") sname=Request.Form("familyname") sq="select*from personal_data where (fname='"&firstname&"' and sname='"&familyname&"')" path=Server.mappath("data/db1.mdb") set con= Server.createobject("ADODB.Connection") con.mode=3 con.open "Provider=Microsoft.Jet.OLEDB.4.0;data source=" &path set R=con.execute(sq) Response.write "<body dir=rtl>" Response.write "<br>הצגת הנרשמים" Response.write "<table align=center border=1> <tr>" Response.write "<td>תעודת זהות</td>" Response.write "<td> שם משפחה </td>" Response.write "<td> שם פרטי </td>" Response.write "</tr>" do until R.eof Response.write "<tr>" Response.write "<td> " & R.fields("id") & "</td>" Response.write "<td> " & R.fields("fname") & "</td>" Response.write "<td> " & R.fields("sname") & "</td>" Response.write "</tr>" R.movenext loop Response.write "</table>" R.close set R=nothing %> </body> </html> Error Type: Microsoft VBScript compilation (0x800A03F6) Expected 'End' |
![]() |
![]() |
# 6 |
אחראי קהילה
|
תוסיף בסוף
קוד:
<% end if %> |
![]() |
![]() |
# 7 |
חבר בקהילה
|
תודה עובד
רק העריכה עדיין מציג לי דף ריק |
![]() |
![]() |
# 8 |
חבר על
|
תחשוב קצת במקום ישר לבוא לפורום ולבקש עזרה בלי לבדוק את הקוד שלך.
לא עשית ELSE לתנאי שבודק אם הסשן קיים.
__________________
דוד בן דוד. |
![]() |
![]() |
חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים) | |
|
|