473,569 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

synonym for StProc prevents ADO.Parameters to Refresh()

hi
i have a stored proc, pointed by a synonym
i wish to execute it vía:

cmd.commandType = adStoredProc
cmd.commandText = "s_MyStoredProc "
cmd.parameters. refresh ---to get the collection

the last line, can't retrieve the Parameters[] collection

if i execute the stored proc directly
the Refresh() method works fine

maybe is there any other commandType for this purpose ?
any idea ?

---
thanks
KS

Jun 14 '07 #1
7 3560
keyser soze wrote:
hi
i have a stored proc, pointed by a synonym
I don't know what you mean by "synonym". You appear to be supplying the
name of a procedure to the commandText
i wish to execute it vía:

cmd.commandType = adStoredProc
Please show actual code: adStoredProc is not a valid constant. I know
what you meant to type, but it makes it obvious that your code is not
real and we have to guess what it actually looks like.
cmd.commandText = "s_MyStoredProc "
cmd.parameters. refresh ---to get the collection
Don't. This is a very bad idea to make ADO make a second trip to the
database just to retrieve the parameter definitions. Either build the
collection yourself, or use the stored-procedure-as-connection-method
technique to execute the procedure
>
the last line, can't retrieve the Parameters[] collection

if i execute the stored proc directly
the Refresh() method works fine
I don't know what you mean by executing it "directly". Provide the code
snippet that allows Refresh(ugh!!) to work.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jun 14 '07 #2
thanks, Bob

i'm talking about "synonym" of sql server 2005
that is, a pointer to -almost- any object

this is my implementation

------------ -------------
database X database Y
------------ -------------
s_MyStoredProc - - - - - - - - - - - MyStoredProc
.....
MyLocalStoredPr oc
....

in a simple case, when i invoke this:
cmd.commandText = "MyLocalStoredP roc"
cmd.Parameters. Refresh()
cmd( 1 ) = myPar_1
...
cmd( N ) = myPar_N
(*) where : cmd is an ADODB.Command object

cmd.Parameters. Refresh() retrieves the parameters collection
in this way, i don't have to create each parameter manually

but ( THIS IS MY CONCERN ) when i try to use:
cmd.commandText = "Y.dbo.MyStored Proc" -or- "s_MyStoredProc "

then, method ADO.Command.Par ameters.Refresh ()
can't retrieve parameters

i know i can simply call the stored proc
connecting directly the app to dabatase Y
but, well, i would like to know
why the way i mention don't works

*** all, using classic asp ***

thanks again
i wait response

friendly, KS

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomescri bió en el mensaje
news:%2******** **********@TK2M SFTNGP03.phx.gb l...
keyser soze wrote:
hi
i have a stored proc, pointed by a synonym

I don't know what you mean by "synonym". You appear to be supplying the
name of a procedure to the commandText
i wish to execute it vía:

cmd.commandType = adStoredProc

Please show actual code: adStoredProc is not a valid constant. I know
what you meant to type, but it makes it obvious that your code is not
real and we have to guess what it actually looks like.
cmd.commandText = "s_MyStoredProc "
cmd.parameters. refresh ---to get the collection

Don't. This is a very bad idea to make ADO make a second trip to the
database just to retrieve the parameter definitions. Either build the
collection yourself, or use the stored-procedure-as-connection-method
technique to execute the procedure

the last line, can't retrieve the Parameters[] collection

if i execute the stored proc directly
the Refresh() method works fine

I don't know what you mean by executing it "directly". Provide the code
snippet that allows Refresh(ugh!!) to work.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jun 15 '07 #3
Well, I have yet to use this "synonym" functionality and, as I said, I
strictly avoid using Parameters.Refr esh in production code so I will not be
able to help here. you might try posting in a sqlserver group.

I have created a tool to generate the parameter creation code. You can get
it here:
http://common.mvps.org/barrowsb/Clas..._generator.zip

keyser soze wrote:
thanks, Bob

i'm talking about "synonym" of sql server 2005
that is, a pointer to -almost- any object

this is my implementation

------------ -------------
database X database Y
------------ -------------
s_MyStoredProc - - - - - - - - - - - MyStoredProc
....
MyLocalStoredPr oc
...

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jun 15 '07 #4
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomescri bió en el mensaje
news:u0******** ******@TK2MSFTN GP03.phx.gbl...
Well, I have yet to use this "synonym" functionality and, as I said, I
strictly avoid using Parameters.Refr esh in production code so I will not
be

what is the technical reason to avoid it ?
able to help here. you might try posting in a sqlserver group.
yes, i did :-(
>
I have created a tool to generate the parameter creation code. You can get
it here:
http://common.mvps.org/barrowsb/Clas..._generator.zip
i go to read it
keyser soze wrote:
thanks, Bob

i'm talking about "synonym" of sql server 2005
that is, a pointer to -almost- any object

this is my implementation

------------ -------------
database X database Y
------------ -------------
s_MyStoredProc - - - - - - - - - - - MyStoredProc
....
MyLocalStoredPr oc
...


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jun 15 '07 #5
keyser wrote on Fri, 15 Jun 2007 11:38:58 -0300:
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomescri bió en el mensaje
news:u0******** ******@TK2MSFTN GP03.phx.gbl...
>Well, I have yet to use this "synonym" functionality and, as I said, I
strictly avoid using Parameters.Refr esh in production code so I will not
be

what is the technical reason to avoid it ?
As Bob mentioned earlier, it causes additional data to be passed back and
forth to the server. Each time you perform Parameters.Refr esh ADO will have
to connect to SQL Server, retrieve the proc definition, and then create the
Parameters collection from the retrieved data. By explicitly writing the
Parameter creation in your code you avoid this - in a heavily hit site this
can have a significant impact on performance.

Dan
Jun 15 '07 #6
keyser soze wrote:
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomescri bió en el mensaje
news:u0******** ******@TK2MSFTN GP03.phx.gbl...
>Well, I have yet to use this "synonym" functionality and, as I said,
I strictly avoid using Parameters.Refr esh in production code so I
will not be

what is the technical reason to avoid it ?
Performance, resources and scalability. Again, every time you execute the
stored procedure requires an extra trip to the database, a trip that can
easily be avoided by either building the parameters collection yourself, or
using a different technique to execute your procedure when an explicit
Parameters collection is not needed, such as when you are passing only input
parameters and you don't need to read the Return parameter value. See my
canned response here:

http://groups.google.com/group/micro...fedf4e1efd63a6
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jun 15 '07 #7
i didn't knew about that "extra-trip"

i think i need to change some things...

your comments was very helpful

Bob, Daniel : thanks
ks

"keyser soze" <ba*********@ho tmail.comescrib ió en el mensaje
news:e6******** ******@TK2MSFTN GP05.phx.gbl...
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomescri bió en el mensaje
news:u0******** ******@TK2MSFTN GP03.phx.gbl...
Well, I have yet to use this "synonym" functionality and, as I said, I
strictly avoid using Parameters.Refr esh in production code so I will not
be

what is the technical reason to avoid it ?
able to help here. you might try posting in a sqlserver group.

yes, i did :-(

I have created a tool to generate the parameter creation code. You can
get
it here:
http://common.mvps.org/barrowsb/Clas..._generator.zip

i go to read it
keyser soze wrote:
thanks, Bob
>
i'm talking about "synonym" of sql server 2005
that is, a pointer to -almost- any object
>
this is my implementation
>
------------ -------------
database X database Y
------------ -------------
s_MyStoredProc - - - - - - - - - - - MyStoredProc
....
MyLocalStoredPr oc
...
>

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jun 15 '07 #8

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

Similar topics

3
32132
by: DCB | last post by:
Hello. I have an easy question, likely, that has me in a headspin. I have an include file to a frames based site that basically forces frames on the end user if they visit the site and hit a non-frames created page... Simply, it is: if (parent != self)
10
6922
by: Bo Rasmussen | last post by:
Hi, I have a problem : I have a form with some buttons. When one of these buttons is pressed a new URL with some parameters to e.g. delete something from a database. The problem is that when the user presses refresh that same URL is fired with the parameters to delete again - this sometimes gives strange behaviour. Is there any way that I...
8
2069
by: CSDunn | last post by:
Hello, I have a situation in which I need to address three SQL Server 2000 Stored Procedure parameters in the OnClick event of an Option Group. The Option Group lives on an Access 2000 ADP form. In another situation where I had to set the RowSource of a combo box based on a parameter value that was delivered to a proc from another combo...
6
4733
by: Jack | last post by:
I have the following: * An OLEDBCommand with command text "SELECT CAMPAIGN, DAY_OUT WHERE (CAMPAIGN LIKE '@campaign')" * A DataAdapter that point the select to the above command * A data grid that I use to display the data * form load code to populate the controls: DsCampaign1 = New DataSet...
12
1739
by: Perre Van Wilrijk | last post by:
Hi there, When I started using VB6, I used to write classes with properties and functions as following ... Private lngf1 As Long Private strf2 As String Public Property Get f1() As Long f1 = lngf1
0
1679
by: Elhanan | last post by:
hi.. i have a small Web Service which is consumed by dotnet application the webservice is located in 2 places. the first is my local tomcat, and the second is in websphere server. problems is that if i generate a proxy from the wsdl in websphere, i can't get the databean if refer the proxy's url my tomcat's (i simply recive null). this...
2
1170
by: Geoffrey Callaghan | last post by:
I have a set of variables in an ASP Page that are sent from another page using properties. This works fine. However, when I refresh that page, those properties are lost. How do I maintain those values between refreshes? I tried creating another set of properties, but that didn't work.
7
2343
by: Randy | last post by:
Hi, I've got a listbox on a form that gets updated by opening another form for data entry. Once the user enters the new item name and clicks "accept", the data entry form closes and the original form with the listbox displays. I'm having trouble getting the listbox to reflect the additional entry. If I close the form and reopen it, the new...
0
1437
by: sqldba20 | last post by:
Is there a way (command or stored procedure) to RECOMPILE or REFRESH a USER DEFINED FUNCTION? I can recompile SPs with sp_recompile and refresh views with sp_refreshView, but I could not find any way to refresh User-defined functions (some of them are like views, with parameters). Environment: SQL 2005 SP2. Thanks !
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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
7924
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. ...
0
8122
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...
1
7673
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...
1
5513
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
3653
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.