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

  • Home
  • SEARCH
  • 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 4081012
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:00:17+00:00 2026-05-20T18:00:17+00:00

What does this Visual Basic 6.0 code below do? However it has been used

  • 0

What does this Visual Basic 6.0 code below do? However it has been used for a search function, I’m not clear with it. So please explain what it does.

Private Sub cmdSearch_Click()
    Dim key As Integer, str As String
    key = InputBox("Enter the Employee No whose details u want to know: ")
    Set rs = Nothing
    str = "select * from emp where e_no=" & key
    rs.Open str, adoconn, adOpenForwardOnly, adLockReadOnly
    txtNo.Text = rs(0)
    txtName.Text = rs(1)
    txtCity.Text = rs(2)
    txtDob.Text = rs(4)
    txtPhone.Text = rs(3)
    Set rs = Nothing
    str = "select * from emp"
    rs.Open str, adoconn, adOpenDynamic, adLockPessimistic
End Sub
  • 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-05-20T18:00:18+00:00Added an answer on May 20, 2026 at 6:00 pm
    Private Sub cmdSearch_Click()
        Dim key As Integer, str As String
        key = InputBox("Enter the Employee No whose details u want to know: ") ''// query the user for a name
        Set rs = Nothing
        str = "select * from emp where e_no=" & key ''//create sql query on the fly
        rs.Open str, adoconn, adOpenForwardOnly, adLockReadOnly ''// create a connection to an sql database
        txtNo.Text = rs(0) ''//assign the results of the query to input fields or labels
        txtName.Text = rs(1)
        txtCity.Text = rs(2)
        txtDob.Text = rs(4)
        txtPhone.Text = rs(3)
        Set rs = Nothing
        str = "select * from emp"
        rs.Open str, adoconn, adOpenDynamic, adLockPessimistic ''// creates a new sql connection and load the whole emp table
    End Sub
    

    Short summary: Ask the user for a name and display the data of the user in labels or textboxes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code has been updated to reference the changes below. This log system create
What does this symbol mean in my Visual Studio IDE? Not the green bar,
I'm wondering why does Visual Studio code analysis give a warning with this little
Does this function has the same behavior that memset ? inline void SetZeroArray( void
What is the meaning of underscore in visual basic? I have this code: Private
(This does not relate to the basic programming questions I usually ask!) We have
Does anyone know the equivalent for doing this in Visual Studio 2008( EnvDTE90 )
I have a Visual Studio 2008 C++ application that does something like this: template<
Does Visual Studio / Resharper support this? By refactor copy I mean to be
Does Visual Studio .NET 2008 come with UISpy? I ask this for for the

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.