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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:39:19+00:00 2026-06-18T14:39:19+00:00

I’ve created a query in Access that looks like this… SELECT project_master.ProjectID, project_master.OracleNum, project_master.BudgetYear,

  • 0

I’ve created a query in Access that looks like this…

SELECT project_master.ProjectID, project_master.OracleNum, project_master.BudgetYear, project_master.ProjectNum, project_master.Description, project_master.Description, project_master.Location, project_master.Region, project_master.ContactOwner, project_master.ContactDesigner, project_master.ProjectPriority, project_master.StartDate, project_master.InitialCloseDate, project_master.CurrentBonus, project_master.CurrentQty, project_master.TotalQty, project_master.TotalQty, project_master.SpendingYTD, project_master.SpendingLTD, project_master.SpendingAnnualBudget, project_master.SpendingForecast, project_master.SpendingMinimumForecast, project_master.SpendingRemainingCommitted, project_master.SpendingSaveOver, project_master.SpendingPushPull, project_master.IsCanceled, project_master.UserComments, project_master.tmp_reporting_selected, project_master.rep_header, project_master.rep_budget, project_master.rep_work_completed, project_master.rep_work_planned_completed, project_master.rep_variance_reason, project_master.rep_work_to_complete, project_master.rep_cutovers, project_master.rep_issues_resolution, project_master.rep_variance_reason1, project_master.rep_work_to_complete1, project_master.rep_cutovers1, project_master.rep_issues_resolution1 FROM project_master WHERE (((project_master.ProjectID)=[projectID]));

Now I’m not familiar with Access whatsoever and I’m trying to make a stored procedure but I just don’t see any option to do so. This query I’ve created seems to take the projectID parameter but when I try to call it in VB.NET and pass it the parameter, I get every record in the table instead of the one I want.

Public Shared Function GetProjectByID(ByVal projectID As Integer) As DataTable
        Dim paramaterList As New List(Of DataParameter)
        paramaterList.Add(New DataParameter("@projectID", projectID, ParameterDirection.Input, OleDb.OleDbType.Integer))
        Return DAL.GetDataTableUsingReader("get_project_by_id", paramaterList)
End Function

Public Shared Function Create(ByVal projectID As Integer) As Project
        If projectID < 1 Then
            Throw New ArgumentException("The project ID is invalid.")
        End If
        Dim dt As DataTable = ProjectSQL.GetProjectByID(projectID)
        If dt.Rows.Count < 1 Then
            Throw New DataException("No project record found by the provided ID.")
        End If
        Return Repackage(dt)(0)
End Function

Friend Shared Function Repackage(ByVal dt As DataTable) As List(Of Project)
    Dim projectList As New List(Of Project)
    For i As Integer = 0 To dt.Rows.Count - 1
        Dim p As New Project
        Dim row As DataRow = dt.Rows(i)
        p.ProjectID = Convert.ToInt32(row("ProjectID"))
        p.OracleNum = Convert.ToString(row("OracleNum"))
        p.BudgetYear = Convert.ToInt32(row("BudgetYear"))
        'etc...
        projectList.Add(p)
    Next
    Return projectList
End Function

Basically, I call the Create() Method and pass it an integer but I get all records returned instead of just one record.

  • 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-18T14:39:20+00:00Added an answer on June 18, 2026 at 2:39 pm
    WHERE (((project_master.ProjectID)=[projectID]))
    

    When the db engine sees [projectID], it does not know you intend that to be a parameter. It thinks you’re referring to the field of the same name. So it returns every row where project_master.ProjectID is equal to itself, which should be all rows whose ProjectID is not null.

    Give the parameter a different name, which doesn’t match any of the fields in your data source.

    WHERE (((project_master.ProjectID)=[which_projectID]))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I

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.