הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   עיה בחיפושים (https://hosts.co.il/forums/showthread.php?t=63381)

typhoonil 24-05-08 13:06

בעיה בחיפושים
 
חיפוש לפי שם פרטי ושם משפחה:
קוד:

  <%
 if session ("adminCheck")<>"true" then
 response.write "כניסה למורשים בלבד!"
else%>
<html>
<head>
 <title> דף הניהול </title>
</head>
<body dir="rtl">
<h1> דף הניהול </h1>
<h2> חיפוש לפי שם פרטי ושם משפחה </h2>
<body background="images\850.gif" dir="rtl">

<%
        fname=Request.Form("firstname")
        sname=Request.Form("familyname")
        sq="select*from personal_data where (firstname='"&fname&"' and familyname='"&sname&"')"
        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("firstname") & "</td>"
        Response.write "<td> " & R.fields("familyname") & "</td>"
        Response.write "</tr>"
        R.movenext

        loop
        Response.write "</table>"
        R.close
        set R=nothing
%>
</body>
</html>
<%
end if
%>

חיפוש לפי שם משפחה:
קוד:

<%
 if session ("adminCheck")<>"true" then
 response.write "כניסה למורשים בלבד!"
else%>
<html>
<head>
 <title> דף הניהול </title>
</head>
<body background="images\850.gif" 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
 
sname=request.form("familyname")
sq="select * from personal_data where (familyname='"&sname&"')"
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 ("firstname")& "</td>"
response.write "<td>" &r.fields ("familyname")& "</td>"
response.write "<td>" &r.fields ("gender")& "</td>"
response.write "<td>" &r.fields ("passa")& "</td>"
response.write "<td>" &r.fields ("email")& "</td>"
response.write "<td>" &r.fields ("namestreet")& "</td>"
response.write "<td>" &r.fields ("city")& "</td>"
response.write "</tr>"
r.movenext
loop
response.write "</table>"
end if
%></body></html>

בשניהם אותה שגיאה מוצגת לי רק הטבלה בלי שום נתונים מה הבעיה?
תודה

aviho1 24-05-08 13:13

תנסה להגדיר את r כrecordset לפני שאתה משתמש בו.
ותוודא שהשמות של הinput בטופס הם כמו שרשמת פה ושיש משהו בטבלה בכלל.

typhoonil 24-05-08 13:28

ה-input הוא בדיוק כמו בטופס עובדה שחיפוש לפי שם פרטי כן עובד לי
ואיפה אני מגדיר את זה כ-recordset?


כל הזמנים הם GMT +2. הזמן כעת הוא 15:32.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ