User Profile

Collapse

Profile Sidebar

Collapse
hehe panda
hehe panda
Last Activity: Jun 14 '11, 06:22 PM
Joined: Feb 25 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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.
    See more | Go to post

    Leave a comment:


  • 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 :)
    See more | Go to post

    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!!!
    See more | Go to post

    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?
    See more | Go to post

    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.
    See more | Go to post

    Leave a comment:


  • hehe panda
    started a topic Recordset becomes NULL after the first use

    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
    ...
    See more | Go to post
    Last edited by Stewart Ross; Feb 27 '11, 03:21 PM. Reason: Added code tags

  • 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.
    See more | Go to post

    Leave a comment:


  • hehe panda
    started a topic Recordset becomes NULL after first read/use

    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...
    See more | Go to post
No activity results to display
Show More
Working...