User Profile
Collapse
-
Thanks. As I mentioned, the objReturn changes itself to NULL too after the first call. It really bothered me to see such weird behavior. I am using Access 2007 and SQL server 2008 R2. Not sure if there is any system or application bugs. -
So I have adapted the most stupid but working solution: I insert the obj into a local table and the read from there. The value will never disappear again :)Leave a comment:
-
Sorry for the late reply and thank you for your suggestion. However, it doesn't seem to work. If obj will be changed to NULL after <code>objRetu rn = obj</code>, then the IsNull(obj) will return true no matter what the original values it.
What is more weird to me is that even objReturn can not be called twice. It changes too!!!Leave a comment:
-
I can't use IsDBNull(obj). I always got "Sub or Function is not defined." error message. Is there any library I need to refer to?Leave a comment:
-
Thanks a lot for the reply. I actually thought about it but couldn't use this method because the column might be NULL. So I always has to test it by using:
If not isnull(recSQL!C ustomer) then
--the value is set to NULL after I test it :(
...
Endif
If the column is null, I can't use fldVal = recSQL!Customer any more. A NULL cannot be assigned to a variable like that.Leave a comment:
-
Recordset becomes NULL after the first use
I have Access as FrontEnd and SQL server as Backend. After I call a stored procedure on the SQL server, I try to read the fields in the recordset. However, one of the column can only be used once. After the first use/read, it becomes NULL for no reason.
Code:-----VBA in Access------ strSQL = "EXEC SP_GetDetails '" & strInput & "'" Set recSQL = ConnSQL.Execute(strSQL) Do While Not
-
I did that and it has two records. The second one's value is NULL though. Will the recordset go to the second record automatically without reaching the row of "recSQL.MoveNex t? I was testing the same row in both debug.print.Leave a comment:
-
Recordset becomes NULL after first read/use
I have Access as FrontEnd and SQL server as Backend. After I call a stored procedure on the SQL server, I try to read the fields in the recordset. However, one of the column can only be used once. After the first use/read, it becomes NULL for no reason.
-----VBA in Access------
strSQL = "EXEC SP_GetDetails '" & strInput & "'"
Set recSQL = ConnSQL.Execute (strSQL)
Do...
No activity results to display
Show More
Leave a comment: