Re: SQL 2000 query that returns a space instead of real data.
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sat, 31 Mar 2007 22:01:34 +0000 (UTC)
Manson Services (MansonServices@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
Sorry, don't know what I was thinking! Also I should mention that many
other fields in this recordset come back just fine. >
===================================================
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_dbconnections_STRING
Recordset1.Source = "SELECT * FROM Members WHERE UserID = " +
Replace(Recordset1__MMColParam, "'", "''")
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
LEIF = Recordset1.Fields.Item("MemberLEIFSearch").Value
Response.Write( " LEIF = '" & LEIF & "' ")
===================================
The results are :
LEIF = ' '
==================================
If I understood your other post correctly, MemberLEIFSearch is a bit
column. Or at least so you believe. Since I've never worked with ASP,
I don't know what I should expect a bit column to be presented as, but
I would guess that it appear as 1 or 0. If you get space, you are
looking at a character value. This is the sort of situation where I
would check that I'm in the database I believe I am.
By the way, you use server-side cursors; client-side cursor are usually
better.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Next by Date: attn: brigid - highly intriguing pics - aj - (1/1)
- Next by thread: attn: brigid - highly intriguing pics - aj - (1/1)
- Index(es):