473,396 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

"HumanJHawkins" <JH******@HumanitiesSoftware.Com> wrote in message
news:i9*****************@newsread2.news.pas.earthl ink.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_TempSolution"
DoCmd.OpenStoredProcedure 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(sResultForm).InputParameters = 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 2702

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

Similar topics

1
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...
1
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
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...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
0
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...
2
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...
4
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...
1
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.