עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

שאלה ב-ASP

Featured Replies

פורסם

יש לי דף HTML שדרכו אני מחפש שם משפחה שנמצא במסד הנתונים

זה קוד דף ה-ASP:

 <html>
<body background="images\850.gif" dir="rtl">
<%
fname=Request.Form("familyname")
sq="select * from personal_data where sname='"&"fname"&"'
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)

Response.write "<body dir=rtl>"
Response.write "<br>רשימת שמות משפחה"
Response.write "<table> <tr>"
Response.write "<td> שם משפחה </td>"
Response.write "</tr>"
do until R.eof
Response.write "<tr><td>" & R.fields ("familyname") & "</td> </tr>"
R.movenext
loop
Response.write "</table> "
Response.write "</body>"
%>
</body>
</html>

זאת השגיאה שאני מקבל:

Error Type:

Microsoft VBScript compilation (0x800A0409)

Unterminated string constant

/shirionsite/w.asp, line 5, column 57

sq="select * from personal_data where sname='"&"fname"&"'

מה הבעיה לא הבנתי

תודה רבה יום טוב

פורסם

זו הבעיה:

where sname='"&"fname"&"'

התיקון:

where sname='" & fname & "'"

פורסם
  • מחבר

ועכשיו אני מקבל את השגיאה:

Error Type:

Microsoft JET Database Engine (0x80040E10)

No value given for one or more required parameters.

/shirionsite/w.asp, line 13

פורסם

אולי בגלל שרשמת

source=" &path

במקום

source=" & path

פורסם
  • מחבר

לא זה לא עובד גם ככה והשגיאה מדברת על כך שלא ניתן ערך לאחד מהמשתנים אבל אני לא מבין לאיזה

פורסם

אני מציע לך להוסיף options explicit בשביל לעבוד יותר נכון.

הגדרת המשתנים ע"י Dimים.

Set לR בתור RecordSet.

תעבוד עם ADO Command בשביל למנוע SQL Injections.

פורסם

השגיאה היא ב-SQL, לא ב-ASP.

תדפיס את sq בשביל לראות אם הוא תקין.

פורסם
  • מחבר

שאלתי מה השגיאה הזאת אומרת

‏‏לא ניתן ערך עבור אחד או יותר מבין הפרמטרים הדרושים.

כשאני כן מכניס את הערך בדף החיפוש

ומה הבעיה אם ככה בקובת בלי הצעות לייעול אני עובד עם ספר מסוים מהבית ספר בלי DIM ודברים כאלה

משפט ה-SQL הוא בדיוק כמו שמופיע בספר

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.