Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8034365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:59:18+00:00 2026-06-05T01:59:18+00:00

Just a quick VB question – I’m using VB6, and I just need to

  • 0

Just a quick VB question –

I’m using VB6, and I just need to add an If…Then statement to prompt the user when they are overwritting a field previously populated in SQL. This will keep additional users from updating the field multiple times without knowing that I updated it already. I’m just unsure of the order of this belongs in. Previously, it was in this order:

  1. On button click, test connection to sql database, and update field userName with user1’s name if it is currently empty.
  2. close sql connection

After adding my If…Then, it’s something more like this:

  1. On button click, test connection, and update field userName with user1’s name IF it is empty.
  2. Once updated, update ‘updated’ boolean field(I added a field to keep track each time there is an sql update) to True.
  3. Added IF statement before End IF on first statement, stating that IF ‘updated’ = True, then display a YES/NO Msgbox prompting user2 to make a decision on whether or not they want to continue to update the userName field for the second time, and overwrite user1’s name, then End If.
  4. End If on the first updating statement.
  5. close sql connection.

End goal is to prevent user2 from overwriting user1’s update immediately without receiving some type of prompt that user1 has already updated it. I’m just not sure if my code should surround the initial updating IF..THEN, or be put inside or it where it initally checks if the field is empty. Any help would be great.

I would have provided the actual code, but it’s proprietary.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:59:21+00:00Added an answer on June 5, 2026 at 1:59 am

    I think this is what you have in mind?

    (connect to SQL, get field)
    If strSQLField = "" Then
        If fUpdated = True Then
            nReturn = MsgBox "Do you want to overwrite the field?", vbYesNo
            If nReturn = vbYes Then
                (do overwrite code here)
            End If
        Else
            (do normal write code here)
        End If
    End If
    (close connection)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just a quick question here. I have a program in which I need to
Just a quick question. Is there any performance difference between using PDO::fetchAll() and PDO::fetch()
Just a quick question: There's the entity (for example User) who is connected with
Just a quick question as I haven't been using jQuery for that long. Is
just a quick question about an issue I am having in vb. I need
Just a quick question. I'm using something like this FileStream fs = new FileStream(fileName,
Just a quick question. If I learn how to develop apps for IPhone using
Just a quick question and I hope that hasn't been asked before. I want
Just a quick question, where do I put the exe that I am trying
just a quick question about the mvc JqueryUI framework, i have a _layout.cshtml page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.