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

al4629740Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Does it compile?

Have you placed a breakpoint on line 7 and then stepped through the code to see if line 8 is executed? For more on debugging see my article on the subject.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
al4629740Author Commented:
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...
0
al4629740Author Commented:
I fixed it.  Here is the change.

If IsNull(rec!DateCompleted) Then
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

al4629740Author Commented:
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
0
Martin LissOlder than dirtCommented:
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.
0
al4629740Author Commented:
It did help.  I will reward the points to him...
0
Martin LissOlder than dirtCommented:
Thanks to you both.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.