Hi all,

I've got this snippet which is not working:

<%
Dim tDATA
Dim oConn

Call Connect(oConn, "")

Set tDATA = Server.CreateObject("ADODB.Recordset")
tDATA.Open "SELECT * FROM MyTable WHERE id = " &
CLng(Request.QueryString("id")), oConn

With tDATA
If Not tDATA.EOF%>
<p><strong><%=tDATA("name")%></strong><br />
</p>
<font size="-1" face="Verdana, Arial, Helvetica,
sans-serif"><%=tDATA("text")%>
<%End If
tDATA.Close
Set tDATA = Nothing
%>
</font>

Can anyone see the problem??

Thanks,
Ivan

Re: What's wrong with this? by James

James
Wed Jun 23 08:13:28 CDT 2004

Define "not working".

"Ivan Debono" <ivanmdeb@hotmail.com> wrote in message
news:OhMHlMSWEHA.1380@TK2MSFTNGP09.phx.gbl...
> Hi all,
>
> I've got this snippet which is not working:
>
> <%
> Dim tDATA
> Dim oConn
>
> Call Connect(oConn, "")
>
> Set tDATA = Server.CreateObject("ADODB.Recordset")
> tDATA.Open "SELECT * FROM MyTable WHERE id = " &
> CLng(Request.QueryString("id")), oConn
>
> With tDATA
> If Not tDATA.EOF%>
> <p><strong><%=tDATA("name")%></strong><br />
> </p>
> <font size="-1" face="Verdana, Arial, Helvetica,
> sans-serif"><%=tDATA("text")%>
> <%End If
> tDATA.Close
> Set tDATA = Nothing
> %>
> </font>
>
> Can anyone see the problem??
>
> Thanks,
> Ivan
>
>



Re: What's wrong with this? by Aaron

Aaron
Wed Jun 23 08:15:30 CDT 2004

You have a With tData, but no End With. (And you don't even utilize the
With construct, anyway.)

Otherwise, you're going to have to be a little wee bit more specific about
what "not working" means.

--
http://www.aspfaq.com/
(Reverse address to reply.)




"Ivan Debono" <ivanmdeb@hotmail.com> wrote in message
news:OhMHlMSWEHA.1380@TK2MSFTNGP09.phx.gbl...
> Hi all,
>
> I've got this snippet which is not working:
>
> <%
> Dim tDATA
> Dim oConn
>
> Call Connect(oConn, "")
>
> Set tDATA = Server.CreateObject("ADODB.Recordset")
> tDATA.Open "SELECT * FROM MyTable WHERE id = " &
> CLng(Request.QueryString("id")), oConn
>
> With tDATA
> If Not tDATA.EOF%>
> <p><strong><%=tDATA("name")%></strong><br />
> </p>
> <font size="-1" face="Verdana, Arial, Helvetica,
> sans-serif"><%=tDATA("text")%>
> <%End If
> tDATA.Close
> Set tDATA = Nothing
> %>
> </font>
>
> Can anyone see the problem??
>
> Thanks,
> Ivan
>
>



Re: What's wrong with this? by Ivan

Ivan
Wed Jun 23 08:36:38 CDT 2004

Stupid me!!

That was it, and also the line: If not tDATA.EOF
had no Then!!!

"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> schrieb im Newsbeitrag
news:OKkVORSWEHA.2844@TK2MSFTNGP11.phx.gbl...
> You have a With tData, but no End With. (And you don't even utilize the
> With construct, anyway.)
>
> Otherwise, you're going to have to be a little wee bit more specific about
> what "not working" means.
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "Ivan Debono" <ivanmdeb@hotmail.com> wrote in message
> news:OhMHlMSWEHA.1380@TK2MSFTNGP09.phx.gbl...
> > Hi all,
> >
> > I've got this snippet which is not working:
> >
> > <%
> > Dim tDATA
> > Dim oConn
> >
> > Call Connect(oConn, "")
> >
> > Set tDATA = Server.CreateObject("ADODB.Recordset")
> > tDATA.Open "SELECT * FROM MyTable WHERE id = " &
> > CLng(Request.QueryString("id")), oConn
> >
> > With tDATA
> > If Not tDATA.EOF%>
> > <p><strong><%=tDATA("name")%></strong><br />
> > </p>
> > <font size="-1" face="Verdana, Arial, Helvetica,
> > sans-serif"><%=tDATA("text")%>
> > <%End If
> > tDATA.Close
> > Set tDATA = Nothing
> > %>
> > </font>
> >
> > Can anyone see the problem??
> >
> > Thanks,
> > Ivan
> >
> >
>
>