on 2012 May 07 6:32 PM
Hi, Visual Basic 6; mysql = ( select something from table )
which will return some columns with some 'NULL's . Expected, no problem.
My If mysql(index) = NULL then else end if.
FAILS all the time.
Am I having a stupid moment?
I can get this to work:
if mysql(index) = "" then else end if
this seems to work, but I can not test on the "null" word. Have I looked at it too many hours? SMILE
Use VB IsNull() method. i.e.,
dim rs as ADODB.recordset set rs=new adodb.recordset rs.open {mysql} do while not rs.EOF if IsNull( rs.Field(1).value) then ... rs.movenext loop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was concerned that null in sybase was different then in MS SQL, the statements do not work the same. I will try the IsNull. Starting at 6am and going until my eyes and brain give out.... is not good any more. thanks I will do it this way. I don't know why I could not see it. SMILE Again thanks
If IsNull(myRSTM(8)) Then Else Me.txtCustomerName = myRSTM(8) End If Works; I am reading a single record and filing out text boxes only. For some reason me.txtValue fails when the field is null. Even Dim string fails. Same code for MS SQL, that is what way throwning me. I don't now this voting thing, your IsNUll fixed it.
User | Count |
---|---|
68 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.