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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:46:30+00:00 2026-05-25T00:46:30+00:00

I am trying to create a procedure with a parameter in SQL Server 2008

  • 0

I am trying to create a procedure with a parameter in SQL Server 2008 and use an unbound textbox to get the result as the Control Source in Access 2010 (Access 2000 – 2003 file format .mdb).

I originally had a dlookup as the control source of the textbox, but it’s too slow.
How can I call the send the parameter from the textbox to the linked stored procedure?

  • 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-25T00:46:31+00:00Added an answer on May 25, 2026 at 12:46 am

    I’m unsure whether this suggestion will be adequate since DLookup is too slow. You might consider showing us your DLookup statement and tell us about the fields it references and their indexes.

    Anyway, I think you could use ADO to fetch a result from your SQL Server stored procedure. Here is a simplified example of one I’ve used to fetch the result of an sp in SQL Server Express.

    Private Sub GetCenterCodes()
        Dim cnn As Object
        Dim rs As Object
    
        Set cnn = CreateObject("ADODB.Connection")
        cnn.ConnectionString = "DRIVER=SQL Server;SERVER=VM2003\SQLEXPRESS;" & _
            "Trusted_Connection=Yes;DATABASE=Inventory"
        cnn.Open
        Set rs = cnn.Execute("EXEC GetCenterCodes 14, 14, 501")
        Debug.Print rs(0)
        rs.Close
        Set rs = Nothing
        cnn.Close
        Set cnn = Nothing
    End Sub
    

    You could build an EXEC statement with value of your parameter. Say it’s a numeric value in a text box named txtParam:

    "EXEC YourSpName " & Me.txtParam
    

    Or if it’s a string, add single quotes in the EXEC:

    "EXEC YourSpName '" & Me.txtParam & "'"
    

    Instead of Debug.Print, store the value to your text box destination.

    Also, I used ODBC for the connection string. You may prefer OLEDB.

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

Sidebar

Related Questions

I am trying to create the following stored procedure in sql server Lat and
I am trying to use CTE in sql server 2008 and consume it in
I am trying to create a stored procedure that takes a bit parameter which
I am trying to create stored procedure which will decide which language to use
I'm trying to programmatically access the result of executing the system stored procedure sp_spaceused.
I have an already existing stored procedure. But when I am trying to create
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
I'm trying to use the following code to create a new SalesInvoice based on
I am trying to create an external stored procedure on an IBM i (V5R4),
I'm new to TVP in SQL Server and trying to understand the basics. 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.