Results 1 to 6 of 6

Thread: Database Connectivity with ASP and ADO

  1. #1
    Join Date
    Jul 2006
    Posts
    191

    Database Connectivity with ASP and ADO

    I have just started doing the ASP (Active Server Pages). I have completed some basic programs related to the ASP. Now I am stuck in connecting database with ASP and ADO. I don't know much about the ADO, so I have not tried many things.!! Can someone provide me the information about the database connectivity with ASP and ADO.? Please provide me the useful information as soon as possible.
    ASUS P5VD1-X
    Intel Pentium Dual Core 3.00GHz
    Maxtor 160GB
    Corsair 1.5GB PC3200 RAM
    Nvidia Geforce 6800 GT 256mb
    Phillips DVD RW
    Magna 500W PSU
    XION II Steel Black Gaming Case

  2. #2
    Join Date
    Nov 2008
    Posts
    1,192

    Re: Database Connectivity with ASP and ADO

    I think that you should know more about the ASP and ADO. ASP uses a technology called ActiveX Data Objects (ADO) to work with databases. ADO is ActiveX technology which is built into the Internet Information Server (IIS). There are 3 major objects in ADO :
    • the Command Object.
    • the Connection Object.
    • and the Recordset object.

    From the above, you will be mainly using the Recordset object. These 3 objects are present, whenever you perform a database operation but every-time it is not necessary to explicitly create all 3 objects.

  3. #3
    Join Date
    Nov 2008
    Posts
    996

    Re: Database Connectivity with ASP and ADO

    You will have to create a variable to access the objects of ADO. The syntax for creating a variable to access these objects in VBScript :
    Code:
    "[variable name] = Server.CreateObject("ADODB.[object name]")"
    To communicate and manipulate a database is the main purpose of using ADO. The types of databases ADO will allow your ASP program to interact include Access, MySQL, and MSSQL.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Database Connectivity with ASP and ADO

    You mostly use the Recordset Object in ADO. So I thought to give you more information about the Recordset. You can create a RecordSet object explicitly, or by executing a command through the Command Object. Some of the properties of Recordset Object which is used very frequently are :
    • RecordCount - The number of records in the RecordSet.
    • BOF - Beginning of file.
    • EOF - End of file.
    • MaxRecords - Maximum number of records returned in a query.
    • CursorType - Forward-only, static,dynamic, and keyset.

  5. #5
    Join Date
    Mar 2008
    Posts
    672

    Re: Database Connectivity with ASP and ADO

    According to me, one of the common tasks in a ASP web application is the retrieval of data from a database. The below coding demonstrates how to pick up data from a database table.
    Code:
    strSQL="SELECT * FROM students"
    set rs=db.execute(strSQL)
    if not rs.eof then
      do
        stud_name=rs("stud_name").value
        strProgram=rs("strProgram").value
        rs.movenext
      loop until rs.eof
    end if
    rs.close
    set rs=nothing

  6. #6
    Join Date
    May 2008
    Posts
    2,389

    Re: Database Connectivity with ASP and ADO

    I am providing you a simple ASP ADO SQL Query. The coding for this :
    Code:
    Set rs = Server.CreateObject("ADODB.RecordSet")
    param = Request.Form("add")
    q = "SELECT * FROM personal WHERE add LIKE '" & param & "'"
    rs.Open q, "DSN=mydsn;"
    
    if NOT rs.EOF then
         while NOT rs.EOF
              Response.Write rs("firstname") & " " & rs("add") & "<BR>"
              rs.MoveNext
         wend
    end if

Similar Threads

  1. Connection and Statement objects in database connectivity
    By VAIJAYI in forum Software Development
    Replies: 5
    Last Post: 28-12-2010, 10:05 PM
  2. Creating Database link in database
    By Lachlann in forum Software Development
    Replies: 3
    Last Post: 28-01-2010, 01:17 PM
  3. Mysql Database Connectivity Issue
    By joquim in forum Networking & Security
    Replies: 1
    Last Post: 26-12-2008, 06:57 PM
  4. convert filemaker pro database to access database
    By Czack in forum MS Office Support
    Replies: 3
    Last Post: 15-04-2007, 01:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,623,221.89660 seconds with 17 queries