Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss Content Posted by Andy Warren
»
Introduction to ADO - The Command Object
31 posts, Page 1 of 4
1
2
3
4
»
»»
Introduction to ADO - The Command Object
Rate Topic
Display Mode
Topic Options
Author
Message
Andy Warren
Andy Warren
Posted Friday, November 16, 2001 12:00 AM
SSCertifiable
Group: Moderators
Last Login: Tuesday, June 11, 2013 6:34 AM
Points: 6,463,
Visits: 1,388
Comments posted to this topic are about the content posted at
http://www.sqlservercentral.com/columnists/awarren/introductiontoadothecommandobject.asp
>
http://www.sqlservercentral.com/columnists/awarren/introductiontoadothecommandobject.asp
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #1654
VR
VR
Posted Wednesday, December 05, 2001 4:33 AM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, August 08, 2002 12:00 AM
Points: 4,
Visits: 1
I have used command object a lot, mostly in the "right" way that has been mentioned. I think that a clearer example of the wrong way could have been explained. If you how wrong something can be, then it will be easier to understand why not to follow in that direction.
Post #24032
Andy Warren
Andy Warren
Posted Wednesday, December 05, 2001 4:55 AM
SSCertifiable
Group: Moderators
Last Login: Tuesday, June 11, 2013 6:34 AM
Points: 6,463,
Visits: 1,388
I'll keep in that mind for the follow up. Thanks for the feedback.
Andy
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #24033
michael.rosqvist
michael.rosqvist
Posted Monday, January 21, 2002 12:23 AM
Grasshopper
Group: General Forum Members
Last Login: Thursday, July 28, 2005 1:01 AM
Points: 17,
Visits: 1
Maybe you could elaborate on the
cmd.Name -parameter. I have had some problems with that.
Post #24034
Andy Warren
Andy Warren
Posted Monday, January 21, 2002 4:43 AM
SSCertifiable
Group: Moderators
Last Login: Tuesday, June 11, 2013 6:34 AM
Points: 6,463,
Visits: 1,388
Problems in what way?
Andy
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #24035
nasdaq
nasdaq
Posted Wednesday, March 20, 2002 7:47 AM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, May 28, 2013 10:28 AM
Points: 8,
Visits: 190
I have tried to use the Command object in the past, although I have been able to use input paramaters I have been unable to use input/output or just output, can you explain a little more in depth about those? Also is there any benifit to using the ADO "Hints" over the constants?
Post #24036
Andy Warren
Andy Warren
Posted Wednesday, March 20, 2002 8:25 AM
SSCertifiable
Group: Moderators
Last Login: Tuesday, June 11, 2013 6:34 AM
Points: 6,463,
Visits: 1,388
You might want to look at a later article I did that covers a VB add in that will generate the command object code for you, a real time saver. I use output params regularly with no problem, just a matter of getting everything set up right. What hints are you referring to?
Andy
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #24037
erichner
erichner
Posted Tuesday, March 11, 2003 12:33 PM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, October 19, 2004 1:51 PM
Points: 4,
Visits: 1
Thanks for the article. I found it very interesting and helpful.
I still have this problem:
' Parameter 1
sParmName1 = "@Cusip"
ocommand.Parameters.Append ocommand.CreateParameter(sParmName1, adVarChar, adParamInput)
params(sParmName1).Value = sSymbol
' Parameter 2
sParmName2 = "@Price" '
Set ADOprm = ocommand.CreateParameter(sParmName2, adNumeric, adParamInput)
ocommand.Parameters.Append ADOprm
ocommand.Parameters(sParmName2).Value = sPrice
The stored procedure is:
create procedure dbo.UpdateLastPriceRaw
(
@Cusip VARCHAR(15),
@Price NUMERIC(17,9)
)
AS
Parameter 1 works fine - but Parameter 2 brings the following error:
The precision is invalid.
?err.Number
-2147467259
If I use the params.refrsh method it works fine (commenting out the ADOPrm SET line)
Is there a way to find out what the error means and how to solve it without using params.refresh?
Post #24038
Andy Warren
Andy Warren
Posted Tuesday, March 11, 2003 12:45 PM
SSCertifiable
Group: Moderators
Last Login: Tuesday, June 11, 2013 6:34 AM
Points: 6,463,
Visits: 1,388
I'll try to look tonight, but a good way to resolve things like this is to do parameters.refresh, then iterate the collection to dump out all the property settings to see what it's using.
Andy
http://www.sqlservercentral.com/columnists/awarren/
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #24039
David.Poole
David.Poole
Posted Thursday, March 13, 2003 2:25 AM
SSCrazy
Group: General Forum Members
Last Login: Yesterday @ 4:13 PM
Points: 2,766,
Visits: 1,442
I do a lot of Web development and one of the problems I find is that the constants (adCmdStoredProcedure) used to indicate command types are rarely defined outside of an MS app. For example, I use DreamWeaver quite a bit.
I have the ADO2.6 command reference book, and yes, in appendix B it has the definitions of these constants, but wouldn't it be great if someone wrote a book that listed the constants and their values
before
the example code?
Incidentally, I have a problem where I am trying to access two separate databases within a Site Server implementation.
If I have a page that accesses my user database using my connection string then everything works OK. Ditto the Site Server functionality.
If I try and use both together on the same page everything goes beserk!
I have tried defining two separate connections but I keep getting Accessed Denied error messages.
Both SiteServer and my user databases are using Windows Integrated security. Both have the required user set up and yet I still get Access Denied!
If I use SA then I am allowed in but there is no way I want to release a piece of code that uses the SA login and password!
Has anyone had anything similar?
LinkedIn Profile
Post #24040
« Prev Topic
|
Next Topic »
31 posts, Page 1 of 4
1
2
3
4
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.