programer

Results 1 to 2 of 2

Thread: programer

  1. #1
    m.s.s.kumar Guest

    Default programer

    please let me know how ican read data form database by using adodb.command and sql statement with where condition

  2. #2
    Join Date
    Dec 1969
    Posts
    2,493

    Default RE: programer

    This example would populate a table with the recordset data<BR><BR>&#060;%<BR><BR>Dim MyID<BR>Dim Conn<BR>Dim connStr<BR>Dim Sql<BR>Dim RS<BR><BR>MyID=Request.QueryString("YourQueryStrin g")<BR><BR><BR>Set conn = Server.CreateObject("ADODB.Connection")<BR>connStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("YourDatabase.mdb") <BR>Conn.Open connStr<BR><BR>Sql = "SELECT * from YourTableName where "<BR>Sql=Sql & "YourTAbleName.RecordID= " & MyID<BR> <BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR>rs.Open Sql, conn, 3, 3<BR>%&#062;<BR><BR>&#060;html&#062;<BR>&#060;head &#062;<BR>&#060;title&#062;Your Title&#060;/title&#062;<BR>&#060;/head&#062;<BR>&#060;body&#062;<BR>&#060;Table&#062 ;<BR>&#060;tr&#062;<BR>&#060;td&#062;Your field Heading&#060;/td&#062;<BR>&#060;td&#062;Your field Heading&#060;/td&#062;<BR>&#060;/tr&#062;<BR>&#060;% Do While Not RS.EOF %&#062;<BR>&#060;tr&#062;<BR>&#060;td&#062;&#060;% =RS("YourFieldName")%&#062;&#060;/td&#062;<BR>&#060;td&#062;&#060;%=RS("YourFieldNam e")%&#062;&#060;/td&#062;<BR>&#060;/tr&#062;<BR>&#060;% RS.MoveNext %&#062;<BR>&#060;% Loop %&#062;<BR>&#060;/Table&#062;<BR>&#060;% RS.Close %&#062;<BR>&#060;% Set RS=Nothing %&#062;<BR>&#060;% Conn.Close %&#062;<BR>&#060;% Set Conn=Nothing %&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •