النتائج 1 إلى 4 من 4

الموضوع: سؤال للمستر asp

  1. #1
    عضو نشيط
    تاريخ التسجيل
    Jun 2001
    المشاركات
    170


    لو أتكرمت تشرح لنا طريقة عمل استعلام داخل قاعدة بيانات اكسس بواسطة الفرنت بيج يعني مثلا
    لدي قاعدة بيانات بها معلومات
    وارغب في عمل صفحة استعلام عن المعلومات داخل قاعدة البيانات من خلال وضع الرقم الخاص بالمنتج مثلا ثم تظهر النتيجة في صفحة أخرى وكيفية إعداد الفورم الذي به صندوق البحث
    اتمنى أن تشرح لي الطريقة أو تدلني على موقع به شرح لهذه الطريقة
    تحياتي





    __________________
    إذا دعتك قدرتك على ظلم الناس فتذكر قدرة الله عليك
    battotah غير متواجد حالياً


  2. #2
    عضو نشيط
    تاريخ التسجيل
    Apr 2001
    المشاركات
    177


    أنا شخصيا ماأستخدم الفرونت بيج لعمل صفحات ال ASP، أستخدم
    Visual InterDev
    أو Script Editor
    و البرنامج الأخير يأتي مع الفرونت بيج ،

    هذا درس -- ادخال حقول فورم إلى قاعدة بيانات أكسس --
    في منتدى الموسوعة العربية
    http://forums.c4arab.net/showthread.php?threadid=2411

    أكيد راح يفيدك





    Mr.ASP غير متواجد حالياً

  3. #3
    عضو نشيط
    تاريخ التسجيل
    Jun 2001
    المشاركات
    170

    شكرا



    شكرا أخي asp
    وفي الحقيقة أستفدت كثيرا من الدرس ولكن الدرس عن طريقة الكتابة في قاعدة البيانات وأنا أريد طريقة الإستعلام في قاعدة البيانات عموما شكري وتقديري لك





    __________________
    إذا دعتك قدرتك على ظلم الناس فتذكر قدرة الله عليك
    battotah غير متواجد حالياً

  4. #4
    عضو نشيط جدا
    تاريخ التسجيل
    Aug 2001
    المشاركات
    410


    ممكن هذا المثال يفيدك
    <%
    ' Declare our variables... always good practice!
    Dim strURL ' The URL of this page so the form will work
    ' no matter what this file is named.

    Dim cnnSearch ' ADO connection
    Dim rstSearch ' ADO recordset
    Dim strDBPath ' path to our Access database (*.mdb) file

    Dim strSQL ' The SQL Query we build on the fly
    Dim strSearch ' The text being looked for

    ' Retreive the URL of this page from Server Variables
    strURL = Request.ServerVariables("URL")

    ' Retreive the term being searched for. I'm doing it on
    ' the QS since that allows people to bookmark results.
    ' You could just as easily have used the form collection.
    strSearch = Request.QueryString("search")

    ' Since I'm doing this all in one page I need to see if anyone
    ' has searched for something. If they have we hit the DB.
    ' O/W I just show the search form and quit.

    %>
    <p>Search our sample db by first or last name. (% returns all)</p>
    <form action="<%= strURL %>" method="get">
    <input name="search" value="<%= strSearch %>" />
    <input type="submit" />
    </form>
    <p>[Try 'am' or 'er' for an example]</p>
    <%
    If strSearch <> "" Then
    ' MapPath of virtual database file path to a physical path.
    ' If you want you could hard code a physical path here.
    strDBPath = Server.MapPath("database.mdb")


    ' Create an ADO Connection to connect to the sample database.
    ' We're using OLE DB but you could just as easily use ODBC or a DSN.
    Set cnnSearch = Server.CreateObject("ADODB.Connection")

    ' This line is for the Access sample database:
    'cnnSearch.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

    ' We're actually using SQL Server so we use this line instead:
    cnnSearch.Open Application("SQLConnString")

    ' Build our query based on the input.
    strSQL = "SELECT last_name, first_name, sales " _
    & "FROM sample " _
    & "WHERE last_name LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
    & "OR first_name LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
    & "ORDER BY last_name;"

    ' Execute our query using the connection object. It automatically
    ' creates and returns a recordset which we store in our variable.
    Set rstSearch = cnnSearch.Execute(strSQL)

    ' Display a table of the data in the recordset. We loop through the
    ' recordset displaying the fields from the table and using MoveNext
    ' to increment to the next record. We stop when we reach EOF.
    ' For fun I'm combining some fields and showwing you can do more then
    ' just spit out the data in the form it is in in the table.
    %>
    <table border="1">
    <tr>
    <th>Name</th>
    <th>Sales</th>
    </tr>
    <%
    Do While Not rstSearch.EOF
    %>
    <tr>
    <td><%= rstSearch.Fields("first_name").Value %> <%= rstSearch.Fields("last_name").Value %></td>
    <td><%= rstSearch.Fields("sales").Value %></td>
    </tr>
    <%

    rstSearch.MoveNext
    Loop
    %>
    </table>
    <%
    ' Close our recordset and connection and dispose of the objects
    rstSearch.Close
    Set rstSearch = Nothing
    cnnSearch.Close
    Set cnnSearch = Nothing
    End If

    ' That's all folks! See it's really not all that hard.
    %>

    http://www.asp101.com/samples/viewas...5Fsearch%2Easp







    MR.NET غير متواجد حالياً





ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض