Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 130
  • Last Modified:

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

0
al4629740
Asked:
al4629740
  • 4
  • 3
1 Solution
 
Martin LissRetired ProgrammerCommented:
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
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 LissRetired ProgrammerCommented:
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 LissRetired ProgrammerCommented:
Thanks to you both.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now