473,405 Members | 2,338 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,405 software developers and data experts.

stored procedure with paramater as rowsource

hi
Is it possible to have a storedprocedure with a parameter as a rowsource
to a combo/list box:
e.g.
me.cbMyCombo.rowsource='exec spMyLookup @Key=12345'

or

me.cbMyCombo.rowsource='spMyLookup 12345'

or

me.cbMyCombo.rowsource='spMyLookup(12345)'

etc
Tia
Glenn
Nov 12 '05 #1
3 7261
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If using DAO: Put the EXEC statement in a pass-thru query. Use the
query as the ComboBox's RowSource.

- --
MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP7LD+4echKqOuFEgEQJZKQCgwQiv9XKCbi4v7DCJBOM2kH of73kAoI/r
F+IPQq7aeRk8CZnGe2o0RhUC
=bro5
-----END PGP SIGNATURE-----
Glenn Davy wrote:
hi
Is it possible to have a storedprocedure with a parameter as a rowsource
to a combo/list box:
e.g.
me.cbMyCombo.rowsource='exec spMyLookup @Key=12345'

or

me.cbMyCombo.rowsource='spMyLookup 12345'

or

me.cbMyCombo.rowsource='spMyLookup(12345)'

etc
Tia
Glenn


Nov 12 '05 #2
based on the idea that a combobox can be based on either a table/query,
valuelist, fieldlist, I would say that with an sp you could either
populate a table in Access or create a Value list

cmd.CommandText = "yourSP"
cmd.CommandType = adCmdStoredProc
cmd.Parameters("@Parm1").Value = 123
Set RS = cmd.Execute

from here you could either populate a table or create your value list.
With ADO you could create a table in memory, but 2 things 1) is it worth
the work 2) I think the combobox needs to be based on a persistent table
(I think).

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
In principle it is a bad idea to dynamically build a value list as the
string space is limited.

If you ever think you need to do this then look at user defined rowsource
functions instead.

Terry
"Rich P" <rp*****@aol.com> wrote in message
news:3f*********************@news.frii.net...
based on the idea that a combobox can be based on either a table/query,
valuelist, fieldlist, I would say that with an sp you could either
populate a table in Access or create a Value list

cmd.CommandText = "yourSP"
cmd.CommandType = adCmdStoredProc
cmd.Parameters("@Parm1").Value = 123
Set RS = cmd.Execute

from here you could either populate a table or create your value list.
With ADO you could create a table in memory, but 2 things 1) is it worth
the work 2) I think the combobox needs to be based on a persistent table
(I think).

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4

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

Similar topics

10
by: Thomas R. Hummel | last post by:
I have a stored procedure that suddenly started performing horribly. The query plan didn't look right to me, so I copy/pasted the code and ran it (it's a single SELECT statement). That ran pretty...
6
by: WertmanTheMad | last post by:
Ok, This sounds dangerous (and yes I know it is) But its in a controlled enviroment and I really need to know how to do this. How can I pass a Subquery for an Exist or In clause as a...
2
by: Not Me | last post by:
Hey, Coming back to a piece of work I did a while back, which used a stored procedure to populate a list box. The SP takes a single parameter, and I think this is the reasoning for using 'exec'...
6
by: Rod Snyder | last post by:
I'm trying to set up a page with an asp.net link button that would send a user to a certain page and on page load execute a specific stored procedure tied to the button on the previous page. The...
1
by: David Hearn | last post by:
I have a SQLDataSource control on one of my web forms. The stored procedure that I am connecting to has two parameters that need to be passed in and one that is returned. One of the parameters I am...
3
by: Bonzol | last post by:
Thanx to the help of other memebers on this group i've gotten to where I am however, I seem unable to add the required paramater to my stored procedure my code Dim toreturn As...
2
by: KaizerV3 | last post by:
Hello, I made a stored procedure where u have to give the date in a paramater and then the result should come. But somehow it doesnt work. It works likes this: CREATE PROCEDURE . AS
1
by: mktilu | last post by:
i want a stored procedure example where it returns both cursor and recordcount as a paramater .
5
by: Dennis | last post by:
Hi I'm trying to alter my stored procedure to take a parameter for the Database Name, but as usual the syntax is killing me. Thanks for any help Dennis ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.