473,880 Members | 2,000 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Solution (Was: Calling Stored Procedure with Paramaters from ADP / Visual Basic)

"HumanJHawk ins" <JH******@Human itiesSoftware.C om> wrote in message
news:i9******** *********@newsr ead2.news.pas.e arthlink.net...
(The SQL Group suggested I post this here... Sorry for the disconnected
cross-post)

Hi,

I am trying to connect a form in an access data project to a stored
procedure on our SQL server.

Without parameters, all I have to do is make a button on the form with a
"run stored procedure" function attached to it. The code in the "run stored procedure" function that works when there are no parameters is:

Dim stProcedureName As String
stProcedureName = "CompareLists_T empSolution"
DoCmd.OpenStore dProcedure stProcedureName , acViewNormal, acEdit


Thanks for the suggestions. The answer turns out to be:

Make the stored procedure the data source for a form. Then put the
parameters into the InputParameters for that form. For example:
sParams = "@Name varchar(16) = '" & sName & "'" & ", @Number Integer = "
& iNumber
DoCmd.OpenForm sResultForm, acFormDS
Forms(sResultFo rm).InputParame ters = sParams

This actually loads the form with default parameters, then reloads with the
correct parameters. So, make sure the default paramters result in a very
fast return time.
Nov 12 '05 #1
0 2758

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1544
by: Brad H McCollum | last post by:
I've designed a very basic SQL Server Stored Procedure that I'm using via a Visual Basic 6.0 front-end file in retrieving records into a data entry form. I can't for the life of me get the records retrieved via the Stored Procedure to be edited. I can't even run the stored procedure in MSDE's T-SQL utility and then edit any of the records shown to me.
1
1735
by: crisp99 | last post by:
Hi, I have a SQL Stored Procedure : CREATE PROCEDURE spFilterOne @city varchar(25) AS SELECT * FROM tblCities WHERE tblCities.strCity = @city ORDER BY tblCities.strName
0
317
by: HumanJHawkins | last post by:
"HumanJHawkins" <JHawkins@HumanitiesSoftware.Com> wrote in message news:i9nac.8030$Dv2.2242@newsread2.news.pas.earthlink.net... > (The SQL Group suggested I post this here... Sorry for the disconnected > cross-post) > > Hi, > > I am trying to connect a form in an access data project to a stored > procedure on our SQL server. >
2
5470
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
0
1971
by: JN | last post by:
Hello, I'm having problem calling stored procedures from Visual FoxPro database. I got the following exception error: "System.Data.OleDb.OleDbException: Unrecognized command verb" It seems like the stored procedures are not recognized by .Net.
2
2145
by: Woody Splawn | last post by:
I am using SQL Server 2000 as the back-end. I have created a stored procedure in SQL server called usp_AddContract. This Stored procedure inserts a new contract into a contracts table. I have tested the code in Enterprise Manager and it works correctly. At the time that I run the SP I pass a contract number and a SSN to the SP and it creates a new contract in the contracts table with a unique value in the ConNum field and SSN field. In...
4
1294
by: dawson | last post by:
Hello, when I execute the following stored procedure in MSVS 2005, it request the three paramaters and returns the correct value/row from the database as expected: CREATE PROCEDURE dbo.clientLogin ( @user_email varchar(50), @user_password varchar(50), @user_id int OUTPUT
1
4233
by: endriu | last post by:
Hi I want to recive some data from db2 (as400) using ado.net in visual basic. Also i want to access them by stored procedure that return a cursor. So, i create very simple stored procedure on as400: P1 : BEGIN BEGIN DECLARE CUR CURSOR WITH RETURN FOR SELECT PRICE, QUANTITY EXPORT . SALES ; OPEN CUR ;
0
2327
by: AJIT PITALE | last post by:
Hi, I am using Visual Basic 6 as front end and Visual FoxPro as a Database. I am trying to pass a parameter from VB to Visual FoxPro's Stored Procedure. I am getting an error showing "Data type mismatch" My Connection String is :CNN.ConnectionString = "Provider=VFPOLEDB.1;Data Source=P:\pay.dbc;Mode=ReadWrite|Share Deny Write" CNN.Open
0
11093
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10811
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10396
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9550
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7951
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5778
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4596
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
2
4192
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3220
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.