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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:06:27+00:00 2026-06-07T04:06:27+00:00

I have accessed a database in VB.NET using the following code: Public Class Form1

  • 0

I have accessed a database in VB.NET using the following code:

Public Class Form1
    Private Sub btnLoad_Click(ByVal sender As System.Object, _
      ByVal e As System.EventArgs) Handles btnLoad.Click
        Dim con As OleDb.OleDbConnection = New OleDb.OleDbConnection
        Dim dbProvider As String
        Dim dbSource As String
        Dim ds As New DataSet
        Dim da As OleDb.OleDbDataAdapter
        Dim sql As String

        dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
        dbSource = "Data Source = AddressBook.mdb"
        con.ConnectionString = dbProvider & dbSource
        con.Open()
        sql = "SELECT * FROM tblContacts"
        da = New OleDb.OleDbDataAdapter(sql, con)
        da.Fill(ds, "Address Book")
        MsgBox("Database Open")
        con.Close()
        MsgBox("Database Closed")
        txtFirstName.Text = ds.Tables("AddressBook").Rows(0).Item(1)
        txtSurname.Text = ds.Tables("AddressBook").Rows(0).Item(2)
    End Sub
End Class  

However in line “txtFirstName.Text = ds.Tables(“AddressBook”).Rows(0).Item(1)”, it gives me an exception saying that an instance of an object should be created. I am not understanding what exactly the problem is. How can I create an instance, and of WHAT should I create an instance?

  • 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-07T04:06:29+00:00Added an answer on June 7, 2026 at 4:06 am

    You used a space in

    da.Fill(ds, "Address Book") 
    

    But no space in

    txtFirstName.Text = ds.Tables("AddressBook").Rows(0).Item(1)
    

    For the name of the table. Therefore a table with name “AddressBook” does not exist.

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

Sidebar

Related Questions

We have an Informix 4GL forms interface to our database, accessed using a terminal
I have an Asp.Net MVC 3 application with a database Consultants, accessed by EF.
I have an asp.net mvc 2 application with a SQL Server database accessed by
I have a list of ordered objects stored in the database and accessed through
I have a database that is accessed by two applications. The first is an
I have a SQL server / database locally and accessed through ip etc... What
I have a database in a format which can be accessed via ODBC. I'm
I am developing an ASP.Net C# web application that should access the database using
HI, I have followed through an example on the net of using SQLCE 4
HI, I have followed through an example on the net of using SQLCE 4

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.