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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:14:19+00:00 2026-05-26T17:14:19+00:00

Ok I can successfully connect to my Access database but I am still learning

  • 0

Ok I can successfully connect to my Access database but I am still learning on how to output that data. Here is the run down.

I am designing a page where the user inputs the customer ID and then gets a list of incidents for that customer. Then I would like the user to be able to add a survey about the incident.

Problem I am running into is the ability to display this data. I have tried various method. Eventually I want to be able to display the data into a listbox and have them select it and take the survey but I am not near that far yet. Here is what I have on the connection and my attempt which doesn’t work to output the data:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim sql As String = "SELECT [Title], [Description] FROM [Incidents] WHERE ([CustomerID] = textbox1.text)"
        Dim conn As New System.Data.OleDb.OleDbConnection()
        conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:\Users\Allen PC7\Documents\Visual Studio 2008\Projects\1-A SportsPro\App_Data\TechSupport.mdb"
        Dim myCommand As New System.Data.OleDb.OleDbCommand(sql, conn)
        conn.Open()
        Dim myReader As System.Data.OleDb.OleDbDataReader = myCommand.ExecuteReader()
        Try
            While myReader.Read()
                Console.WriteLine(myReader.GetInt32(0).ToString() + ", " + myReader.GetString(1))
            End While
        Finally
            myReader.Close()
            conn.Close()
        End Try

    End Sub

I just can’t get anything displayed in the console and instead get an error saying Dim myReader As System.Data.OleDb.OleDbDataReader = myCommand.ExecuteReader()…System.Data.OleDb.OleDbException: No value given for one or more required parameters.

Thanks

  • 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-26T17:14:19+00:00Added an answer on May 26, 2026 at 5:14 pm

    You are not passing in a proper value to the SQL:

    "SELECT [Title], [Description] FROM [Incidents] WHERE ([CustomerID] = textbox1.text)"
    

    It will try to look for CustomerID that is equal to the database value “textbox1.text”. Since this is probably the wrong data type and a table/column that doesn’t exist, you are getting the error.

    You should be using a parameterized query to avoid SQL Injection.

    Dim sql As String = "SELECT [Title], [Description] FROM [Incidents] WHERE ([CustomerID] = ?)"
    
    Dim myCommand As New System.Data.OleDb.OleDbCommand(sql, conn)
    myCommand.Parameters.Add("@p1", OleDbType.Integer, 4).Value = textbox1.text
    

    This will fail if the value in textbox1.text is not of the right type – you should both validate and convert to the right type (my code assumes an integer).

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

Sidebar

Related Questions

I can successfully connect to MySQL from a DOS prompt, but when I try
I can successfully connect to the database with my datacontext object. I am able
I can successfully include main jquery files in /Scripts, but if my custom test.js
I have an HBITMAP containing alpha channel data. I can successfully render this using
I can successfully retrieve data asynchronously through NSURLConnection from any other part in the
I have an ivy.xml that can successfully resolve all of its dependencies, except the
I'm currently using NSURLConnection to test if I can successfully connect to a server.
I currently support an MS Access database that has linked connections using the Microsoft
I am able to successfully connect from access 2007 into SQL Server 2008 using
Can anyone explain how I can successfully get my processes communicating? I find 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.