HP3000-L Archives

October 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Christian Dercq <[log in to unmask]>
Reply To:
Date:
Sat, 27 Oct 2001 11:01:54 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (81 lines)
Dear All,
I have to query an HP3000 through ASP and OBDCLink/SE driver
If I try the code below, I allways receive a Recordcount = -1
The Database is opened wihout problem (with no error)
I am quite sure the query must return some records. Could someone help me ?



<%@ language="VBScript" %>
<!-- #include file ="validate.inc"-->
<% dim dbconnection , dbrecordset
   dim cNom,cFileName
   cNom = Request.form("Name")
   cFileName=session("cFile")

   set dbconnection=server.createobject("adodb.connection")
   dbconnection.open "dsn=”HP3000”

   dim sql
   sql = "select * from users where Nom='" & cNom & "' order by Nom"

   set dbrecordset=server.createobject("adodb.recordset")
   dbrecordset.open sql,dbconnection,3,3
%>


<html>

<head>
<meta http-equiv="Content-Language" content="fr-be">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Lien</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body background="images/bordure.gif">
<% if dbrecordset.recordcount=0 then %>

            <table border="0" width="400">
            <tr>
    <td align="center" width="90"> </td>
    <td align="center" bgcolor="#E5E5E5"> <font face="Arial" size="2"> Pas
de Record</font> </td>
            </tr>
            </table>

<% else %>
            <table border="0" width="400">
            <tr>
    <td bgcolor="#C0C0C0">Nom</td>
    <td bgcolor="#C0C0C0">Prénom</td>
    </tr>
            <% for i=1 to dbrecordset.recordcount %>
                        <tr>
                <td bgcolor="#E5E5E5"><a
href="details.asp?id=<%=dbrecordset.fields("id").value %>" target="_self">
<%=dbrecordset.fields("Nom").value %></td>
                <td bgcolor="#E5E5E5"><%=dbrecordset.fields("prenom").value
%></a>&nbsp;</td>
                <% dbrecordset.movenext %>
                        </tr>
            <%next %>
            </table>

<% end if %>
<br>
<a href="menu.asp" target="_self">Nouvelle recherche - New Search</a>

</body>

</html>


<% set dbconnection=nothing
   set dbrecordset=nothing %>

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2