Database Code
  Home arrow Database Code arrow Using Command Object with Parameters synta...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE CODE

Using Command Object with Parameters syntax example
By: aspfree
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2002-03-30

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Command Object Example

    <% @language="vbscript" ENABLESESSIONSTATE = FALSE %>
    <!--#include file="adovbs.inc"-->
    <%
    On Error Resume Next
    response.buffer=True
    dim conn

    set conn = server.createobject("adodb.connection")
    conn.open "DSN"

    response.write request.form("CompanyName") & "<br>"
    strCompanyName = request.form("CompanyName")
    strCompanyAddress1 = request.form("CompanyAddress1")
    strCompanyAddress2 = request.form("CompanyAddress2")
    strCompanyCity = request.form("CompanyCity")
    strCompanyState =request.form("CompanyState")
    strCompanyZip = request.form("CompanyZip")
    strCompanyCountry =request.form("CompanyCountry")
    strCompanyURL = request.form("CompanyURL")
    strContactName = request.form("ContactName")
    strContactPhone = request.form("ContactPhone")
    strContactEmail = request.form("ContactEmail")
    strComponentName = request.form("ComponentName")
    strComponentDownloadlink = request.form("ComponentDownloadLink")
    strComponentDemoLink = request.form("ComponentDemoLink")
    strComponentDesc = request.form("ComponentDesc")
    strPrice = request.form("Price")
    strCompanyID = request.form("CompanyID")

    set cmd1 = server.createobject("adodb.command")
    with cmd1
        .activeconnection = strconn
        .commandtext = "sp_updateComponentInfo"
        .CommandType = acCmdStoredProc
    '    .parameters.append .createparameter("@CompanyName", adVarChar, adParamInput, 150, strCompanyName)
        .parameters.append .createparameter("@CompanyAddress1", adVarChar, adParamInput, 255 , strCompanyAddress1)
        .parameters.append .createparameter("@CompanyAddress2", adVarChar, adParamInput, 255 , strCompanyAddress2)
        .parameters.append .createparameter("@CompanyCity", adVarChar, adParamInput, 150 , strCompanyCity)
        .parameters.append .createparameter("@CompanyState", adVarChar, adParamInput, 50 , strCompanyState)
        .parameters.append .createparameter("@CompanyZip", adVarChar, adParamInput, 50 , strCompanyZip)
        .parameters.append .createparameter("@CompanyCountry", adVarChar, adParamInput, 100 , strCompanyCountry)
        .parameters.append .createparameter("@CompanyURL", adVarChar, adParamInput, 255 , strCompanyURL)
        .parameters.append .createparameter("@ContactName", adVarChar, adParamInput, 100 , strContactName)
        .parameters.append .createparameter("@ContactPhone", adVarChar, adParamInput, 100 , strContactPhone)
        .parameters.append .createparameter("@ContactEmail", adVarChar, adParamInput, 150, strContactEmail)
        .parameters.append .createparameter("@ComponentName", adVarChar, adParamInput, 100 , strComponentName)
        .parameters.append .createparameter("@ComponentDownloadlink", adVarChar, adParamInput, 255 , strComponentDownloadLink)
        .parameters.append .createparameter("@ComponentDemoLink", adVarChar, adParamInput, 255 , strComponentDemoLink)
        .parameters.append .createparameter("@ComponentDesc", adVarChar, adParamInput, 255 , strComponentDesc)
        .parameters.append .createparameter("@Price", adVarChar, adParamInput, 50 , strPrice)
        .parameters.append .createparameter("@companyID", adInteger, adParamInput, 0 , strCompanyID)
        .parameters.append .createparameter("@CompanyName", adVarient, adParamInput, 150, strCompanyName)
        .execute lngRecs, , adExecuteNoRecords
    End With
    set cmd1 = nothing
    If err.number <> 0 Then
    response.write err.number
    response.write err.description
    response.end
    End If
    %>

    <html>
    <head><title></title></head>
    Your information is updated!
    </body>
    </html>


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Database Code Articles
    More By aspfree

     

    IBM® developerWorks developerWorks - FREE Tools!


    IBM DB2 Deep Compression ROI Tool

    The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times.
    FREE! Go There Now!


    NEW! Accelerating Software Innovation on i on Power Systems

    Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, for an overview of Rational’s new software offerings and resources to help modernize and accelerate software innovation on i on Power Systems – while ensuring past application investments are protected and continue to grow. Learn how these solutions are helping customers extend their core i5/OS solutions toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time.
    FREE! Go There Now!


    NEW! Build Web services with transport-level security using Rational Application Developer V7, Part 1: Build Web services and Web services clients

    Build secure Web services with transport-level security using IBM Rational Application Developer V7 and IBM WebSphere Application Server V6.1. Follow this three-part series for step-by-step instructions about how to develop Web services and clients, configure HTTP basic authentication, and configure HTTP over SSL (HTTPS). This first part of the series walks you through building a Web service for a simple calculator application. You generate and test two different types of Web services clients: a Java Platform, Enterprise Edition (Java EE) client and a stand-alone Java client. You also handle user-defined exceptions in Web services.
    FREE! Go There Now!


    NEW! Did you say mainframe? e-kit

    Learn how you can extend modern application lifecycle management to IBM System z through the IBM Rational Software Delivery Platform (SDP). The Did you say mainframe? e-kit includes podcasts, webcasts, tutorials, white and red papers, demos, and articles designed to help ease the challenges of modernizing your enterprise. This complimentary kit for mainframe developers is a practical, how-to guide for making the most of an existing development environment, including the skills and infrastructure already in place at an established enterprise.
    FREE! Go There Now!


    NEW! Don't wait! Try the Rational Application Developer (RAD) v7.5 open beta code today

    Download the Rational Application Developer (RAD) v7.5 open beta code and start developing applications for the JEE5 standard which features EJB3.0, JPA, JSF 1.2, JSP 2.1 and Servlet 2.5 standards. When you use this beta you will see how you can increase developer productivity for already existing applications with improved support for refactoring, as well as adding new features to existing applications. In addition, the beta provides tooling for JD Edwards, Oracle, SAP, Siebel and PeopleSoft to improve the developer productivity with these enterprise systems.
    FREE! Go There Now!


    NEW! Improve your build process with IBM Rational Build Forge, Part 2: Automate builds for a real-world Tomcat project

    Learn how Rational Build Forge can extend a simple compile and package build process by adding customization and deployment capability. Go from a manual method to automating: checking for code changes; getting the latest source; compiling and packaging; customizing; copying to and restarting a deployment server; and sending e-mail notification that a new version is available.
    FREE! Go There Now!


    NEW! Krugle, developerWorks, and code search

    Ken Krugler, co-founder of code search company Krugle, and Laura Merling, vice president of Marketing and Business Development for Krugle, join to talk about the ins and outs of code search and what it means as a new feature for developerWorks users.
    FREE! Go There Now!


    NEW! Run your first CICS application on a PC using TXSeries for Windows

    Learn the basics of the IBM Customer Information Control System (CICS). With a hands-on exercise, learn how to get your first CICS application up and running on your desktop using TXSeries V6.1 for Windows. The tutorial shows you how to download and install a free trial version of TXSeries V6.1.
    FREE! Go There Now!


    NEW! Trial download: IBM Informix Dynamic Server Express Edition V11.0

    Informix Dynamic Server (IDS) Express Edition offers outstanding online transaction processing (OLTP) database performance, while helping to simplify and automate many of the tasks associated with deploying databases for small business applications. IDS 11 further extends the ease of management and applications integration with the Admin API and Scheduler, high availability with Continuous Log Restore for backup server recovery in case of a primary server failure, and column level encryption to protect personal and company private data.
    FREE! Go There Now!


    NEW! Webcast: Application security testing and Web compliance

    Join the IBM Watchfire team for an informative discussion on techniques and best practices to proactively manage Web application security and how to effectively build application security testing into the software development lifecycle (SDLC). In this Software Delivery Platform webcast you will learn: How to better understand potential web application security vulnerabilities, best practices and how to effectively integrate application security testing into the software development lifecycle, the importance of detecting and removing software vulnerabilities during application development.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    DATABASE CODE ARTICLES

    - Deployment of the MobiLink Synchronization M...
    - MobiLink Synchronization Wizard in SQL Anywh...
    - Finding Matching Records in Data Access Pages
    - Using the AccessDataSource Control in VS 2005
    - A Closer Look at ADO.NET: The Command Object
    - A Closer Look at ADO.NET: The Connection Obj...
    - Using ADO to Communicate with the Database, ...
    - Code Snippets: Counting Records
    - Constraints In Microsoft SQL Server 2000
    - Multilingual entries into a DB and to be dis...
    - Two combos, one textbox example
    - ADO Recordset Paging
    - SQL Server Database Creator - .NET Version
    - Getting A List of Tables From SQL Server
    - Discussion & Listserv Module by Mike Eck...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek