473,563 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Call a stored procedure with user inputted parameter

23 New Member
I am trying to call a stored SQL procedure while either passing or accepting a used inputted parameter. Currently I have a variable coded to accept the number I need to pass, but I do not know how to pass that number along with the the SQL call.
My current code is as follows:
Expand|Select|Wrap|Line Numbers
  1. Private Sub butMoveNDStoBO_Click()
  2. On Error GoTo Err_butMoveNDStoBO_Click
  3.  
  4.     Dim RecordNo As Long
  5.     Dim SQL As String
  6.  
  7.     RecordNo = InputBox(Prompt:="Enter Record Number")
  8.     SQL = "EXEC usp_MoveNDS_to_BO"
  9.  
  10.     DoCmd.RunSQL SQL
  11.  
  12.  
  13. Exit_butMoveNDStoBO_Click:
  14.     Exit Sub
  15.  
  16. Err_butMoveNDStoBO_Click:
  17.     MsgBox Err.Description
  18.     Resume Exit_butMoveNDStoBO_Click
  19.  
  20. End Sub
  21.  
Jun 1 '07 #1
5 2289
NeoPa
32,564 Recognized Expert Moderator MVP
I'm guessing this is for SQL Server from Access?
Can you be a little more clear with the question please.
Jun 2 '07 #2
OtheymAverian
23 New Member
I am sorry... Yes I am making a call to an SQl server from Access. Should I be using the SQL forum instead? I was a little confused on which forum I should use.

I am trying to modify an existing ADP to avoid some error messages we started getting when we switched from using access 02 to access 07. We initially had a button which activated a macro that accepted user input (6 digit number) to determine which record to move/delete.

I am not terribly fluent with Access or SQL (kinda learning as I go...). In Access '07's help file I found the command "DoCmd.RunS QL" and was able to adapt the majority of out macro calling buttons, but the basic fix did not work with the buttons that require user input.

The stored procedure expects to get passed a field titles "RecordNo" to select the record and move/delete it. I do not know how to provide this parameter with the DoCmd.RunSQL command.
Jun 4 '07 #3
OtheymAverian
23 New Member
Solved the problem a different way. Please close this thread
Jun 4 '07 #4
NeoPa
32,564 Recognized Expert Moderator MVP
I'll try to look out for something tomorrow.
If I don't reply in one way or another by end of play, then bump the thread again.
Jun 4 '07 #5
NeoPa
32,564 Recognized Expert Moderator MVP
Solved the problem a different way. Please close this thread
Sorry, I missed your later post yesterday. We'll treat this as done then :)
Good luck with your project.
Jun 5 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
6686
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft Visual Basic .NET version of this article, see 308049. For a Microsoft Visual C++ .NET version of this article, see 310071. For a Microsoft Visual J#...
7
2213
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL tabel. I know the SP works, because a smalldatetime-field in the database is changed. I've tried to disable viewstate on all textbox controls. Any...
13
4781
by: Larry Menard | last post by:
Test code: $dbconn = odbc_connect($dbname, $username, $password); $path = "C:\Temp\myJar.jar"; $statement = "CALL SQLJ.INSTALL_JAR('file://$path', 'myJarId')"; $result = odbc_exec($dbconn, $statement); Result: PHP Warning: odbc_exec(): SQL error: CLI0119E Unexpected system failure.
7
3437
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function 'UpdateRegistrant' expects parameter '@EMail', which was not supplied. The field value was null in the database and not changed in the FormView so is...
0
19264
by: IamtheEvster | last post by:
Hi All, I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a hell of a time with it... The following comes from phpinfo(): PHP Version: 5.1.2 mysql Client API version: 5.0.18 mysqli Client API version: 5.0.18
3
4300
by: harborboy76 | last post by:
I am calling the exact same stored procedure called myprocedure from 2 different boxes from the CLP, but I'm experiencing different behaviors between them. After I was unable to get any support from IBM due to V7.1 being no longer supported, I figure someone here might be able to help. Is DB2 V7 more forgiving in the way I can call my...
4
4988
by: Pakna | last post by:
Hi, is there any way to call a JAVA stored procedure from a SQL Trigger? We are having difficulties with this and cannot verify whether DB2 even *has* this capability? Thank you very much....
3
4198
by: .Net Sports | last post by:
I need to call an stored procedure from an asp script, I don't need to do an Output parameter, only input parameters on 3 vars, but I get a "BOF EOF not true or record has been deleted" error when trying to call the page with the correct querystrings. The stored procedure looks like it's properly called , as i tried misspelling the stored...
2
10541
by: savio XCIX | last post by:
I created the following stored procedure: ======= CREATE PROCEDURE TBLNAME.proc_test (IN p_custnum VARCHAR(8), IN p_zipcode CHAR(5), OUT r_valid CHAR(1), ...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.