Link to home
Start Free TrialLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

Can't save value from vb6 to db

The following DateCompleted column does not save.  Is there anything wrong with my syntax?

esql = "select * from tblOrgMonthlyReport where MonthlyID = " & MonthlyID
            rec.CursorLocation = adUseClient
            rec.Open (esql), conn, adOpenDynamic, adLockOptimistic
                        
                     
            
            If rec!DateCompleted Is Nothing Then
            rec!DateCompleted = ServerTime
            End If
            
            rec.Update
            rec.Close

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of al4629740

ASKER

yes it does.

And when I put a breakpoint, line 8 is not executed.  There is a null value, so it SHOULD execute, but does not...
I fixed it.  Here is the change.

If IsNull(rec!DateCompleted) Then
I've requested that this question be closed as follows:

Accepted answer: 0 points for al4629740's comment #a40295837

for the following reason:

I answered the question
If the author can honestly say that it wasn't my suggestion in post ID: 40295827 that he set a breakpoint as he said he did in post ID: 40295833, then I don't have any objection.
It did help.  I will reward the points to him...
Thanks to you both.