Strange ASP behavior

vootmon

Guppy
Hello, we had to migrate an Access Database to a MsSQL server database. Things are working pretty well, but one problem we are having is when we select data from larger tables, we noticed that we can't get all the data. We select every column by name in the select and only the ones we need. This is the weird part...if we just reference a column, say by doing a Response.Write(recset("col")), then it changes what data we can see in our form we are trying to populate...
Has anyone seen this before?
Thanks in advance! :D
 
I've noticed two things that need to be done with MSSQL when using text fields:

1. The text field(s) must be the last one(s) on the table if field types other than text exist.

2. The cursor type must be set to dynamic (Recordsetname.CursorType = 2)

Unless these two procedures are followed, text fields may be truncated or may not display at all when using response.write.
 
I've also noticed that if you read a record in firehose mode (forwardonly), then text fields can only be read in ONCE. Subsequent references to the column come back empty.

I usually assign a variable to the column value before outputting it - eg. s = recset("col") : response.write s - that seems to help in most cases.

Otherwise yes, use a dynamic recordset. In fact if you're only reading in ONE record, then that's the most server-efficient recordset type to use.
 
Back
Top