ASP ODBC Connection to UniData


   dim objU2Conn, objRst

   Set objU2Conn = Server.CreateObject("ADODB.Connection")
   objU2Conn.Open "DSN=DSName;Uid=UserID;Pwd=password"

   Set objRst = Server.CreateObject("ADODB.Recordset")

   ss = "select * from myFile "

   objRst.open ss, objU2Conn

   Response.Write "<tr>"
   Response.Write "<td width=100>First Name</td>"
   Response.Write "<td width=100>Last Name</td>"
   Response.Write "<td width=100>Amount</td>"
   Response.Write "<td width=80>Year</td></tr>"
   Response.Write "<tr><td><br></td></tr>"

   while Not objRst.EOF
     Response.Write "<tr>"
     Response.Write "<td> " & objRst("fname") & "</td>"
     Response.Write "<td> " & objRst("lname") & "</td>"
     Response.Write "<td> " & objRst("amount") & "</td>"
     Response.Write "<td> " & objRst("year") & "</td>"
     Response.Write "</tr>"
     objRst.MoveNext
   wend

   objRst.Close
   objU2Conn.Close


Hosted by www.Geocities.ws

1