![]() |
problem using isnull() to check a value in ADODB.Recordset
Hello,
i found a strange behavior when trying to branch with isNull on a NULL value returned in a recorordset. The following query: SQL = "select distinct (ergebnis_state.name), ergebnis.kommentar " & _ "from ergebnis_state " & _ "join ergebnis on(ergebnis.ergebnis_state_id=ergebnis_state.id) " & _ "join ergebnis_parameter on(ergebnis_parameter.ergebnis_id=ergebnis.id) " & _ "join default_werte on(default_werte.id=ergebnis_parameter.parameter_i d) " & _ "join werte_kategorie on(werte_kategorie.id=default_werte.werte_kategori e_id) " & _ "join session on(ergebnis.session_id=session.id) " & _ "join testcase on(ergebnis.testcase_id=testcase.id) " & _ "where default_werte.wert='" & swv & "' " & _ "and werte_kategorie.name='" & SW_PARAMETER & "' " & _ "and session.progress_state_id='2' " & _ "and testcase.name like '" & tc_id & "%';" returns a recordset with two values (name, kommentar) in each row. If i step through the code and put the mouse pointer once on rec!kommentar Dim rec As ADODB.Recordset .. .. .. If IsNull(rec!kommentar) Then aCommentVerdict.comment = "" Else aCommentVerdict.comment = rec!kommentar End If the correct expression (e.g. "no transfer possible!") is shown. If i leave the focus of rec!kommentar with the mouse pointer an re-enter focus on rec!kommentar it shows a empty string "" (without executing a further step in the code!)!? So does VBA without stepping through the code and executing the code in non-stepping mode. The assignment of rec!kommentar to another variable (e.g. the string type aCommentVerdict.comment) is set to ""!? If i assign the value without using previously isNull the assignment works. Is there a known problem with isNull? regards, Peter Versions used: MS Excel 2002 (10.6501.6714) SP3 MySQL ODBC BS MS Windows 2000 Professional Version 5.0.2195 Service Pack 4 Build 2195 MySQL ODBC 3.51 Driver DSN, Version 3.5.07 |
All times are GMT +1. The time now is 04:12 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com