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

  • Home
  • SEARCH
  • 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 8236863
In Process

The Archive Base Latest Questions

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

The Following code returns a stored procedure with a hard value coded. I need

  • 0

The Following code returns a stored procedure with a hard value coded. I need to allow 74 to change to whatever is selected from a combo box. Any help is greatly appreciated. I am using a pass through query in Access.

Private Sub ok_Click()
    Dim objConnection As New ADODB.Connection    
    Dim objCom As ADODB.Command
    Dim provStr As String

    Set objCom = New ADODB.Command

    objConnection.Provider = "sqloledb"

    provStr = "Data Source=**;" & "Initial Catalog=IKB_QA;User Id=**;Password=**;"

    objConnection.Open provStr

    With objCom
        .ActiveConnection = objConnection
        .CommandText = "dbo.ix_spc_planogram_match 74"
        .CommandType = adCmdStoredProc

        .Execute
    End With

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-07T19:16:29+00:00Added an answer on June 7, 2026 at 7:16 pm

    The following code grabs parameter from form and executes the stored procedure.

    Dim Cmd1 As ADODB.Command
    Dim lngRecordsAffected As Long
    Dim rs1 As ADODB.Recordset
    Dim intRecordCount As Integer
    '-----
    Dim cnnTemp As ADODB.Connection
    Set cnnTemp = New ADODB.Connection
    cnnTemp.ConnectionString = "DRIVER=SQL Server;SERVER=***;" & _
    "Trusted_Connection=No;UID=***;PWD=***;" & _
    "Initial Catalog=IKB_QA;"
    cnnTemp.ConnectionTimeout = 400
    'Open Connection
    cnnTemp.Open
    Set Cmd1 = New ADODB.Command
    Cmd1.ActiveConnection = cnnTemp
    
    '---
    
    With Cmd1
    Dim localv As Integer
    Dim inputv
    
    localv = [Forms]![start]![Selection]![cat_code]
    .CommandText = "dbo.ix_spc_planogram_match " & inputv
    .CommandType = adCmdStoredProc
    Set inputv = Cmd1.CreateParameter("@catcode", 3, 1, 10000, localv)
    Cmd1.Parameters.Append inputv
    Set rs1 = Nothing
    Set rs1 = Cmd1.Execute
    
    localv = 0
    Do While Not rs1.EOF
    
    Debug.Print rs1.Fields.Item("POG_DBKEY").Value = "POG_DBKEY"
    Debug.Print rs1.Fields.Item("COMP_POG_DBKEY").Value = "COMP_POG_DBKEY"
    Debug.Print rs1.Fields.Item("CURR_SKU_CNT").Value = "CURR_SKU_CNT"
    Debug.Print rs1.Fields.Item("COMP_SKU_CNT").Value = "COMP_SKU_CNT"
    Debug.Print rs1.Fields.Item("SKU_TOTAL").Value = "SKU_TOTAL"
    Debug.Print rs1.Fields.Item("MATCHD").Value = "MATCHD"
    localv = localv + 1
    
    rs1.MoveNext
    Loop
    localv = localv
    
    rs1.Close
    Set rs1 = Nothing
    Set rs1 = Nothing
    
    End With
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to return a varchar from stored procedure with the following code:
The following code returns the error from the For Each loop. I have similar
I am writing a stored procedure in MySQL. The following is the code I
i have the following stored procedure that returns the sent emails of the latest
I have the following C code which uses a stored procedure to insert 2
I have a stored procedure simplified to the following code: SET NOCOUNT ON DECLARE
I just found the following code inside a stored procedure. BEGIN SELECT @MyVar =
I am using the following code to consume a CUBRID database java stored procedure.
I found the following stored procedure from here , while creating this stored procedure
I currently have the following code in a stored procedure (see below). In an

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.