Re: Forward-only recordsets



The offending code is store-bought. The client is doing a social networking
site. The code is called eMates from EnthrallWeb.com. You are absolutely
correct. The code is garbage.

You are also correct about the text columns. They are varchar(max)
datatypes. Switching them to varchar(xxx) fixed the problem with the field
ordering.

I've never run into the issue before. Thanks for your help.


"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message
news:u4rJK8$nIHA.6096@xxxxxxxxxxxxxxxxxxxxxxx
JohnnyC wrote:
I've got a strange problem with a forward-only recordset.

The front-end is an ASP web. The backend is a sql2005 database.

In the code, there are sql statements using '*'. For example "select
* from tableA"

This is pretty universally regarded as a bad practice in production
code: http://www.aspfaq.com/show.asp?id=2096

The recordset is populated using the
connection.execute method. i.e. set rs = conn.execute(sql)

When referencing the fields in the recordset, if they are not
referenced in the same order as the underlying table, we are getting
blanks returned. If I use explicit field names in the sql call, it
doesn't matter the order of how we read the rs fields.

It may be an issue with the datatypes. Are you using ODBC and are Text
or Image columns involved?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.




.



Relevant Pages

  • Re: Forward-only recordsets
    ... The backend is a sql2005 database. ... there are sql statements using '*'. ... When referencing the fields in the recordset, ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: Bind a field to a textbox
    ... Stephen Cairns wrote: ... > The connection cannot be used to perform this operation. ... I prefer to assign my sql statements to a ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Returning value using Stored Procedure and ASP
    ... After trying to get them into the right datatypes and that not ... varDuration, varTripPlace, varTripPurpose, varChoicesGiven ... As for the conn.InsertTrip technique, you won't find much about this ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Returning value using Stored Procedure and ASP
    ... Well, don't undo everything! ... After trying to get them into the right datatypes and that not ... varDuration, varTripPlace, varTripPurpose, varChoicesGiven ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: SQL issue
    ... then stritem2 ... What datatypes are they supposed to be? ... Microsoft MVP -- ASP/ASP.NET ... Please reply to the newsgroup. ...
    (microsoft.public.scripting.vbscript)