We're converting our Access databases to MS SQL Server. I'm currently working on ASP applications using server-side VBScript, connected to SQL via ADODB objects. I've run into the following problem, and I can't find an answer. One newsgroup had a message asking the same question, but it was asked in 10/2001 and still hadn't been answered
I open a recordset using the following syntax:
Set Conn = Server.CreateObject("ADODB.Connection")
sql = "SELECT * FROM TableX WHERE RecordID = '" & Request.QueryString("RecordID") & "';"
Set RSET = Conn.Execute(sql)
The result is a single record which passes the 'If RSET.EOF else' test.
I then move to the first record with RSET.MoveFirst (just in case it returns multiple records) and display the fields with calls to RSET("FieldName").
Some of the fields display with no problem. Further down the page, fields I know are populated are returning a "" or NULL value. Data type doesn't seem to matter. It's happened with bit fields, ntext, nvarchar, etc.
Have tried removing all fields from any tables to see if table nesting was causing some obscure problem. No joy.
Even more strange: If I go back near the beginning of the page and call one of the 'missing' fields, it displays properly there -and- further down in the page where it wasn't showing up before. This does not seem to happen consistently, though. Calling all the fields at the beginning of the operation and assigning them to vbscript variables was unsuccessful.