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 8760685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:06:31+00:00 2026-06-13T15:06:31+00:00

Trying to create a username/password validation form. getting the the following error Object variable

  • 0

Trying to create a username/password validation form. getting the the following error “Object variable or with block variable not set” when i click login button i.e comamand1_click(). when i click debug it points to

> rs.ActiveConnection = conn

The code that i typed:

Dim a
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset

Private Sub Command1_Click()
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider = Microsoft.ACE.OLEDB.12.0; Data Source = C:\VB Project\logindetails1.mdb"
conn.Open

If conn = Null Then
    MsgBox ("no db")
    End
End If

rs.ActiveConnection = conn
rs.Source = "select * from login"
rs.Open

rs.MoveFirst
While Not rs.EOF
If Text1.Text = rs.Fields("id") And Text2.Text = rs.Fields("password") Then
    a = 1
Else
    a = 0
End If
Wend
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing

If a = 1 Then
    MsgBox ("Login Successful!!")
Else
    MsgBox ("Invalid Details!!")
End If
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
End Sub

Private Sub Command3_Click()
End
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-06-13T15:06:32+00:00Added an answer on June 13, 2026 at 3:06 pm

    I think your rs (ADODB.Recordset) variable is Nothing.

    You need to create the object.

    Set rs = New ADODB.Recordset
    

    Also, I think you’ll need to use the Set keyword when setting the recordset’s connection:

    Set rs.ActiveConnection = conn
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a registration form. In this form there are some fields(username,password
Trying to create a background-image slideshow and am getting this error... This is the
I'm trying to create a database in couchdb, which has an admin user/password set,
I am trying to create a test that can enter a username and password
I'm trying create a gui using Tkinter that grabs a username and password and
I'm trying to create a simple username/password login screen. I have the layout done,
I am trying to create an email validation form for my database but am
I'm trying to create an email validation for user registration. I am following step
I am trying to write a Username selector. What is does is create a
Trying to create Database as follows: USE Master GO IF NOT EXISTS(SELECT [Name] FROM

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.