Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why do I need to call IsNull twice 1

Status
Not open for further replies.

tootired

Programmer
Aug 28, 2002
25
0
0
GB
In reading a record set (from Access 2000, if it matters) I find that I have to call IsNull twice. In the following fragment you owuld think that "NULL2" is never displayed, yet I find that it is.

Any ideas?

Thanks in advance,

JonathanC

While rs.EOF = False
str = ""
For i = 0 To rs.Fields.Count - 1
If i > 0 Then str = str & ","
If IsNull(rs.Fields(i).Value) Then
str = str & "NULL1"
ElseIf IsNull(rs.Fields(i).Value) Then
str = str & "NULL2"
Else
str = str & Trim(rs.Fields(i).Value)
End If
Next
List1.AddItem str
rs.MoveNext
Wend
 
I am not sure if this is a solution but I know that I have had some strange problems when using a server-side cursor locations. This was with ADO and SQL Server Text field datatypes however.

My suggestion, is try using a client-side cursor location for the connection. It might work, it might not.

Si [afro]
 
sifitz you are a star! Changing to a client-side cursor gets rid of the behaviour. I shall now spend a few hours reading about these pesky cursor things.

Thanks a lot

Jonathan Clarke
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top