Inserting Full Stops into SQL Server 2000 using ASP and stored procedure

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Inserting Full Stops into SQL Server 2000 using ASP and stored procedure

    Hi All,

    I am attempting to use a standard HTML form to pass a parameter to an
    ASP stored procedure, which searches a database for customer records.
    I include the stored procedure below, as well as the form code and ASP
    commands. Everything on it works fine, until a user puts several full
    stops into the Notes field (represented on the form by a TEXTAREA
    tag), which is searching on a database field type of ntext. I have
    also tried changing the type to nvarchar(500) to no effect. When
    several full stops are input, the request fails with the following
    error message:

    ADODB.Command error '800a0d5d'

    Application uses a value of the wrong type for the current operation.

    I have tried searching the various groups, and ASP faq sites and have
    found no mention of this as a known bug so i'm a bit at a loss! I'm
    sure it's something silly i've missed!

    I'm using IIS 6 on Win2k3 server, with ASP connecting to an SQL Server
    2000 on a different machine running win2k server.

    The stored procedure is shown below:

    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS ON
    GO

    CREATE PROCEDURE sp_customersearch
    @customerid int,
    @firstname nvarchar(100) = NULL,
    @surname nvarchar(100) = NULL,
    @address1 nvarchar(100) = NULL,
    @district nvarchar(100) = NULL,
    @towncity nvarchar(100) = NULL,
    @county nvarchar(50) = NULL,
    @postcode nvarchar(50) = NULL,
    @country nvarchar(50) = NULL,
    @telephone nvarchar(50) = NULL,
    @email nvarchar(200) = NULL,
    @notes ntext = NULL,
    @custref nvarchar(50) = NULL
    AS
    SELECT CustomerID, Surname, Forenames, Address1, District, TownCity,
    County, Postcode, Country, Telephone, Email, Notes, CustomersRef,
    Discount, Catalogues FROM dbo.Customers
    WHERE
    CASE @customerid
    WHEN 0 THEN @customerid
    ELSE Customers.CustomerID
    END
    = @customerid
    AND (COALESCE(Forenames, '' ) LIKE COALESCE(@firstname,Forenames, ''))
    AND (COALESCE(Surname, '') LIKE COALESCE(@surname,Surname, ''))
    AND (COALESCE(Address1, '') LIKE COALESCE(@address1,Address1, ''))
    AND (COALESCE(District, '') LIKE COALESCE(@district,District, ''))
    AND (COALESCE(TownCity, '') LIKE COALESCE(@towncity,TownCity, ''))
    AND (COALESCE(County, '') LIKE COALESCE(@county,County, ''))
    AND (COALESCE(Postcode, '') LIKE COALESCE(@postcode,Postcode,''))
    AND (COALESCE(Country, '') LIKE COALESCE(@country,Country,''))
    AND (COALESCE(Telephone, '') LIKE COALESCE(@telephone,Telephone,''))
    AND (COALESCE(Email, '') LIKE COALESCE(@email,Email,''))
    AND (COALESCE(Notes, '') LIKE COALESCE(@notes,Notes,''))
    AND (COALESCE(CustomersRef, '') LIKE
    COALESCE(@custref,CustomersRef,''))
    ORDER BY CustomerID

    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS ON
    GO

    The ADO command is shown below (it was generated using Dreamweaver):

    <%

    Dim cmdCustSearch__customerid
    cmdCustSearch__customerid = "0"
    if(Request("customerid") <> "") then cmdCustSearch__customerid =
    Request("customerid")

    Dim cmdCustSearch__firstname
    cmdCustSearch__firstname = null
    if(Request("firstname") <> "") then cmdCustSearch__firstname =
    Request("firstname")

    Dim cmdCustSearch__surname
    cmdCustSearch__surname = null
    if(Request("surname") <> "") then cmdCustSearch__surname =
    Request("surname")

    Dim cmdCustSearch__address1
    cmdCustSearch__address1 = null
    if(Request("address1") <> "") then cmdCustSearch__address1 =
    Request("address1")

    Dim cmdCustSearch__district
    cmdCustSearch__district = null
    if(Request("district") <> "") then cmdCustSearch__district =
    Request("district")

    Dim cmdCustSearch__towncity
    cmdCustSearch__towncity = null
    if(Request("towncity") <> "") then cmdCustSearch__towncity =
    Request("towncity")

    Dim cmdCustSearch__county
    cmdCustSearch__county = null
    if(Request("county") <> "") then cmdCustSearch__county =
    Request("county")

    Dim cmdCustSearch__postcode
    cmdCustSearch__postcode = null
    if(Request("postcode") <> "") then cmdCustSearch__postcode =
    Request("postcode")

    Dim cmdCustSearch__country
    cmdCustSearch__country = null
    if(Request("country") <> "") then cmdCustSearch__country =
    Request("country")

    Dim cmdCustSearch__telephone
    cmdCustSearch__telephone = null
    if(Request("telephone") <> "") then cmdCustSearch__telephone =
    Request("telephone")

    Dim cmdCustSearch__email
    cmdCustSearch__email = null
    if(Request("email") <> "") then cmdCustSearch__email =
    Request("email")

    Dim cmdCustSearch__notes
    cmdCustSearch__notes = null
    if(cstr(Request("notes")) <> "") then cmdCustSearch__notes =
    cstr(Request("notes"))

    Dim cmdCustSearch__custref
    cmdCustSearch__custref = null
    if(Request("custref") <> "") then cmdCustSearch__custref =
    Request("custref")

    %>
    <%

    set cmdCustSearch = Server.CreateObject("ADODB.Command")
    cmdCustSearch.ActiveConnection = MM_connNews_STRING
    cmdCustSearch.CommandText = "dbo.sp_customersearch"
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@RETURN_VALUE", 3, 4)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@customerid", 3,
    1,4,cmdCustSearch__customerid)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@firstname", 200,
    1,100,cmdCustSearch__firstname)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@surname", 200,
    1,100,cmdCustSearch__surname)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@address1", 200,
    1,100,cmdCustSearch__address1)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@district", 200,
    1,100,cmdCustSearch__district)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@towncity", 200,
    1,100,cmdCustSearch__towncity)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@county", 200,
    1,50,cmdCustSearch__county)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@postcode", 200,
    1,50,cmdCustSearch__postcode)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@country", 200,
    1,50,cmdCustSearch__country)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@telephone", 200,
    1,50,cmdCustSearch__telephone)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@email", 200,
    1,200,cmdCustSearch__email)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@notes", 200,
    1,16,cmdCustSearch__notes)
    cmdCustSearch.Parameters.Append
    cmdCustSearch.CreateParameter("@custref", 200,
    1,50,cmdCustSearch__custref)
    cmdCustSearch.CommandType = 4
    cmdCustSearch.CommandTimeout = 0
    cmdCustSearch.Prepared = true
    set rsCustSearch = cmdCustSearch.Execute
    rsCustSearch_numRows = 0

    %>

    I hope this is all the information you all need to offer me some
    advice! Please let me know if i can provide any more information.

    Thanx in advance,


    James Currer
    James Currer Guest

  2. Similar Questions and Discussions

    1. SQL Server Stored Procedure Authentication
      Hello, I am tyring to add a level of security to my application with using a username and password to authenticate to the database with when...
    2. Stored Procedure inserting the same record twice
      I have created a stored procedure in SQL SERVER 2000 (procedure below) and I have used and slightly edited the command behaviour to insert data into...
    3. RecordCount with Stored Procedure in SQL Server
      Hi everyone, I have noticed that if I used a stored procedure to populate an ADO RecordSet it only returns a .RecordCount property if that stored...
    4. Deploying a Db2 PL stored procedure on the production server
      We are setting up a DB2 (UDB 8.1) environment. I need some guidance to set up the development and deployment process. Lets say I have a...
    5. Can "Computed Column" be a stored procedure in SQL Server 2000?
      I am looking forward suggestions and solutions. I have a table and would like to add a "computed column" for reporting performance reason. The...
  3. #2

    Default Re: Inserting Full Stops into SQL Server 2000 using ASP and stored procedure

    Notes is an ntext parameter, however you are indicating it as an adVarChar
    (200). Try 203 (which represents ntext).
    > AND (COALESCE(District, '') LIKE COALESCE(@district,District, ''))
    Maybe you meant to make this a little more simple:

    AND District = COALESCE(@district, District)

    (No reason to use LIKE in this case; without wildcards, it will only match
    equality anyway.)
    > AND (COALESCE(Notes, '') LIKE COALESCE(@notes,Notes,''))
    Ugh! Are you really going to compare an NTEXT column using LIKE? WHY???

    BTW, why are you using unicode strings? Are you going to be supporting
    foreign alphabets? See [url]http://www.aspfaq.com/2354[/url]






    "James Currer" <phaser2001@hotmail.com> wrote in message
    news:57df26d.0308210618.d9aa3a1@posting.google.com ...
    > Hi All,
    >
    > I am attempting to use a standard HTML form to pass a parameter to an
    > ASP stored procedure, which searches a database for customer records.
    > I include the stored procedure below, as well as the form code and ASP
    > commands. Everything on it works fine, until a user puts several full
    > stops into the Notes field (represented on the form by a TEXTAREA
    > tag), which is searching on a database field type of ntext. I have
    > also tried changing the type to nvarchar(500) to no effect. When
    > several full stops are input, the request fails with the following
    > error message:
    >
    > ADODB.Command error '800a0d5d'
    >
    > Application uses a value of the wrong type for the current operation.
    >
    > I have tried searching the various groups, and ASP faq sites and have
    > found no mention of this as a known bug so i'm a bit at a loss! I'm
    > sure it's something silly i've missed!
    >
    > I'm using IIS 6 on Win2k3 server, with ASP connecting to an SQL Server
    > 2000 on a different machine running win2k server.
    >
    > The stored procedure is shown below:
    >
    > SET QUOTED_IDENTIFIER OFF
    > GO
    > SET ANSI_NULLS ON
    > GO
    >
    > CREATE PROCEDURE sp_customersearch
    > @customerid int,
    > @firstname nvarchar(100) = NULL,
    > @surname nvarchar(100) = NULL,
    > @address1 nvarchar(100) = NULL,
    > @district nvarchar(100) = NULL,
    > @towncity nvarchar(100) = NULL,
    > @county nvarchar(50) = NULL,
    > @postcode nvarchar(50) = NULL,
    > @country nvarchar(50) = NULL,
    > @telephone nvarchar(50) = NULL,
    > @email nvarchar(200) = NULL,
    > @notes ntext = NULL,
    > @custref nvarchar(50) = NULL
    > AS
    > SELECT CustomerID, Surname, Forenames, Address1, District, TownCity,
    > County, Postcode, Country, Telephone, Email, Notes, CustomersRef,
    > Discount, Catalogues FROM dbo.Customers
    > WHERE
    > CASE @customerid
    > WHEN 0 THEN @customerid
    > ELSE Customers.CustomerID
    > END
    > = @customerid
    > AND (COALESCE(Forenames, '' ) LIKE COALESCE(@firstname,Forenames, ''))
    > AND (COALESCE(Surname, '') LIKE COALESCE(@surname,Surname, ''))
    > AND (COALESCE(Address1, '') LIKE COALESCE(@address1,Address1, ''))
    > AND (COALESCE(District, '') LIKE COALESCE(@district,District, ''))
    > AND (COALESCE(TownCity, '') LIKE COALESCE(@towncity,TownCity, ''))
    > AND (COALESCE(County, '') LIKE COALESCE(@county,County, ''))
    > AND (COALESCE(Postcode, '') LIKE COALESCE(@postcode,Postcode,''))
    > AND (COALESCE(Country, '') LIKE COALESCE(@country,Country,''))
    > AND (COALESCE(Telephone, '') LIKE COALESCE(@telephone,Telephone,''))
    > AND (COALESCE(Email, '') LIKE COALESCE(@email,Email,''))
    > AND (COALESCE(Notes, '') LIKE COALESCE(@notes,Notes,''))
    > AND (COALESCE(CustomersRef, '') LIKE
    > COALESCE(@custref,CustomersRef,''))
    > ORDER BY CustomerID
    >
    > GO
    > SET QUOTED_IDENTIFIER OFF
    > GO
    > SET ANSI_NULLS ON
    > GO
    >
    > The ADO command is shown below (it was generated using Dreamweaver):
    >
    > <%
    >
    > Dim cmdCustSearch__customerid
    > cmdCustSearch__customerid = "0"
    > if(Request("customerid") <> "") then cmdCustSearch__customerid =
    > Request("customerid")
    >
    > Dim cmdCustSearch__firstname
    > cmdCustSearch__firstname = null
    > if(Request("firstname") <> "") then cmdCustSearch__firstname =
    > Request("firstname")
    >
    > Dim cmdCustSearch__surname
    > cmdCustSearch__surname = null
    > if(Request("surname") <> "") then cmdCustSearch__surname =
    > Request("surname")
    >
    > Dim cmdCustSearch__address1
    > cmdCustSearch__address1 = null
    > if(Request("address1") <> "") then cmdCustSearch__address1 =
    > Request("address1")
    >
    > Dim cmdCustSearch__district
    > cmdCustSearch__district = null
    > if(Request("district") <> "") then cmdCustSearch__district =
    > Request("district")
    >
    > Dim cmdCustSearch__towncity
    > cmdCustSearch__towncity = null
    > if(Request("towncity") <> "") then cmdCustSearch__towncity =
    > Request("towncity")
    >
    > Dim cmdCustSearch__county
    > cmdCustSearch__county = null
    > if(Request("county") <> "") then cmdCustSearch__county =
    > Request("county")
    >
    > Dim cmdCustSearch__postcode
    > cmdCustSearch__postcode = null
    > if(Request("postcode") <> "") then cmdCustSearch__postcode =
    > Request("postcode")
    >
    > Dim cmdCustSearch__country
    > cmdCustSearch__country = null
    > if(Request("country") <> "") then cmdCustSearch__country =
    > Request("country")
    >
    > Dim cmdCustSearch__telephone
    > cmdCustSearch__telephone = null
    > if(Request("telephone") <> "") then cmdCustSearch__telephone =
    > Request("telephone")
    >
    > Dim cmdCustSearch__email
    > cmdCustSearch__email = null
    > if(Request("email") <> "") then cmdCustSearch__email =
    > Request("email")
    >
    > Dim cmdCustSearch__notes
    > cmdCustSearch__notes = null
    > if(cstr(Request("notes")) <> "") then cmdCustSearch__notes =
    > cstr(Request("notes"))
    >
    > Dim cmdCustSearch__custref
    > cmdCustSearch__custref = null
    > if(Request("custref") <> "") then cmdCustSearch__custref =
    > Request("custref")
    >
    > %>
    > <%
    >
    > set cmdCustSearch = Server.CreateObject("ADODB.Command")
    > cmdCustSearch.ActiveConnection = MM_connNews_STRING
    > cmdCustSearch.CommandText = "dbo.sp_customersearch"
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@RETURN_VALUE", 3, 4)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@customerid", 3,
    > 1,4,cmdCustSearch__customerid)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@firstname", 200,
    > 1,100,cmdCustSearch__firstname)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@surname", 200,
    > 1,100,cmdCustSearch__surname)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@address1", 200,
    > 1,100,cmdCustSearch__address1)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@district", 200,
    > 1,100,cmdCustSearch__district)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@towncity", 200,
    > 1,100,cmdCustSearch__towncity)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@county", 200,
    > 1,50,cmdCustSearch__county)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@postcode", 200,
    > 1,50,cmdCustSearch__postcode)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@country", 200,
    > 1,50,cmdCustSearch__country)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@telephone", 200,
    > 1,50,cmdCustSearch__telephone)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@email", 200,
    > 1,200,cmdCustSearch__email)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@notes", 200,
    > 1,16,cmdCustSearch__notes)
    > cmdCustSearch.Parameters.Append
    > cmdCustSearch.CreateParameter("@custref", 200,
    > 1,50,cmdCustSearch__custref)
    > cmdCustSearch.CommandType = 4
    > cmdCustSearch.CommandTimeout = 0
    > cmdCustSearch.Prepared = true
    > set rsCustSearch = cmdCustSearch.Execute
    > rsCustSearch_numRows = 0
    >
    > %>
    >
    > I hope this is all the information you all need to offer me some
    > advice! Please let me know if i can provide any more information.
    >
    > Thanx in advance,
    >
    >
    > James Currer

    Aaron Bertrand - MVP Guest

  4. #3

    Default Re: Inserting Full Stops into SQL Server 2000 using ASP and stored procedure

    Hi Aaron,

    Thanx for taking the time to post a reply to my message.
    > Notes is an ntext parameter, however you are indicating it as an adVarChar
    > (200). Try 203 (which represents ntext).
    I tried changing the data type representation as you specified (to
    203), and it didn't have any effect unfortunately. The ADO command was
    created thru the Dreamweaver MX gui actually, so perhaps i should take
    up this incorrect ADO parameter format problem with Macromedia!
    > > AND (COALESCE(District, '') LIKE COALESCE(@district,District, ''))
    >
    > Maybe you meant to make this a little more simple:
    >
    > AND District = COALESCE(@district, District)
    >
    > (No reason to use LIKE in this case; without wildcards, it will only match
    > equality anyway.)
    >
    > > AND (COALESCE(Notes, '') LIKE COALESCE(@notes,Notes,''))
    >
    > Ugh! Are you really going to compare an NTEXT column using LIKE? WHY???
    I apologise for my messy SQL but i wasn't entirely sure what i was
    doing, and i'm loathed to change it now cos it's working!!
    > BTW, why are you using unicode strings? Are you going to be supporting
    > foreign alphabets? See [url]http://www.aspfaq.com/2354[/url]
    >
    I actually had no idea i was using unicode strings, but I consulted
    with some of the users and it's possible we might need some foreign
    alphabet characters, so i'll just leave it as it is for now!

    Since my initial posting, this problem has cropped up again, this time
    in an ADO parameter of a similar style, but for a stored procedure
    that inserts records in to the database. This is also an ntext field,
    and it displays the same error:

    ADODB.Command error '800a0d5d'

    Application uses a value of the wrong type for the current operation.

    I'm totally at a loss, but the sample data i'm working with in this
    field has lots of full stops in - this is the only thing i can see
    would be causing a problem. This parameter is declared as follows:

    cmdImportBook.Parameters.Append
    cmdImportBook.CreateParameter("@p_placepubdate", 203,
    1,16,cmdImportBook__p_placepubdate)

    The string being inserted into the field (contained in variable
    cmdImportBook__p_placepubdate) is as follows:

    "1972. International Geological Congress. First. Book - VG, softback.
    6.5x9. 446pp. Many b&w illus."

    and the relevant stored procedure parameter code:

    @p_placepubdate ntext

    I have declared this parameter last in the SQL, and last in the ADO
    parameter list. I have also tried moving the parameter about in the
    ADO parameter declaration list, to no avail.

    Thank you in advance for any additional help you could provide.

    James Currer
    James Currer Guest

  5. #4

    Default Re: Inserting Full Stops into SQL Server 2000 using ASP and stored procedure

    I've created a Stored Procedure Code Generator tool which you can find here:
    [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp&c=&a=clear[/url]

    You will need to define the ADO constants used by the generated code. You
    can do that by using #include to include the adovbs.inc file which you can
    locate in ...\Program Files\Common Files\System\ADO. A better way is
    described here: [url]http://www.aspfaq.com/show.asp?id=2112[/url]

    HTH,
    Bob Barrows


    James Currer wrote:
    > cmdImportBook.Parameters.Append
    > cmdImportBook.CreateParameter("@p_placepubdate", 203,
    > 1,16,cmdImportBook__p_placepubdate)
    >
    > The string being inserted into the field (contained in variable
    > cmdImportBook__p_placepubdate) is as follows:
    >
    > "1972. International Geological Congress. First. Book - VG, softback.
    > 6.5x9. 446pp. Many b&w illus."
    >
    > and the relevant stored procedure parameter code:
    >
    > @p_placepubdate ntext
    >
    > I have declared this parameter last in the SQL, and last in the ADO
    > parameter list. I have also tried moving the parameter about in the
    > ADO parameter declaration list, to no avail.
    >
    > Thank you in advance for any additional help you could provide.
    >
    > James Currer


    Bob Barrows Guest

  6. #5

    Default Re: Inserting Full Stops into SQL Server 2000 using ASP and stored procedure


    "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    news:ey2VxX$dDHA.2680@TK2MSFTNGP11.phx.gbl...
    > I've created a Stored Procedure Code Generator tool which you can find
    here:
    >
    [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp&c=&a=clear[/url]

    Bob

    The above link produced this error :(

    ===============================
    Error connecting to the database: 80004005
    Source: Microsoft OLE DB Provider for ODBC Drivers
    Description: [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Specified
    SQL server not found.

    ADODB.Recordset error '800a0e7d'

    The connection cannot be used to perform this operation. It is either closed
    or invalid in this context.

    /homepg.asp, line 26
    ====================================

    Tried it twice about 3 mins apart 08:38 BST

    Peter


    Peter James Guest

  7. #6

    Default Re: Inserting Full Stops into SQL Server 2000 using ASP and stored procedure

    It seems to be working now. It's not my site. Sloan graciously offered to
    host this free app for me.

    Bob Barrows

    Peter James wrote:
    > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > news:ey2VxX$dDHA.2680@TK2MSFTNGP11.phx.gbl...
    >> I've created a Stored Procedure Code Generator tool which you can
    >> find here:
    >>
    >
    [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp&c=&a=clear[/url]
    >
    > Bob
    >
    > The above link produced this error :(
    >
    > ===============================
    > Error connecting to the database: 80004005
    > Source: Microsoft OLE DB Provider for ODBC Drivers
    > Description: [Microsoft][ODBC SQL Server Driver][TCP/IP
    > Sockets]Specified SQL server not found.
    >
    > ADODB.Recordset error '800a0e7d'
    >
    > The connection cannot be used to perform this operation. It is either
    > closed or invalid in this context.
    >
    > /homepg.asp, line 26
    > ====================================
    >
    > Tried it twice about 3 mins apart 08:38 BST
    >
    > Peter


    Bob Barrows Guest

  8. #7

    Default Re: Inserting Full Stops into SQL Server 2000 using ASP and stored procedure

    Bob,

    Many thanks! Your Stored Procedure Code Generator tool is a lifesaver!
    using the code it generated for my stored procedure, i was able to get
    the routine to work!

    I can't thank you enough for your help!

    Best wishes

    James Currer

    "Bob Barrows" <reb_01501@yahoo.com> wrote in message news:<ey2VxX$dDHA.2680@TK2MSFTNGP11.phx.gbl>...
    > I've created a Stored Procedure Code Generator tool which you can find here:
    > [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp&c=&a=clear[/url]
    >
    > You will need to define the ADO constants used by the generated code. You
    > can do that by using #include to include the adovbs.inc file which you can
    > locate in ...\Program Files\Common Files\System\ADO. A better way is
    > described here: [url]http://www.aspfaq.com/show.asp?id=2112[/url]
    >
    > HTH,
    > Bob Barrows
    >
    >
    > James Currer wrote:
    > > cmdImportBook.Parameters.Append
    > > cmdImportBook.CreateParameter("@p_placepubdate", 203,
    > > 1,16,cmdImportBook__p_placepubdate)
    > >
    > > The string being inserted into the field (contained in variable
    > > cmdImportBook__p_placepubdate) is as follows:
    > >
    > > "1972. International Geological Congress. First. Book - VG, softback.
    > > 6.5x9. 446pp. Many b&w illus."
    > >
    > > and the relevant stored procedure parameter code:
    > >
    > > @p_placepubdate ntext
    > >
    > > I have declared this parameter last in the SQL, and last in the ADO
    > > parameter list. I have also tried moving the parameter about in the
    > > ADO parameter declaration list, to no avail.
    > >
    > > Thank you in advance for any additional help you could provide.
    > >
    > > James Currer
    James Currer Guest

  9. #8

    Default Re: Inserting Full Stops into SQL Server 2000 using ASP and stored procedure

    You're welcome. I'm glad it helped.
    You should examine the code so you see what it does and how. You may get
    some ideas to use in your own apps.

    Bob


    James Currer wrote:
    > Bob,
    >
    > Many thanks! Your Stored Procedure Code Generator tool is a lifesaver!
    > using the code it generated for my stored procedure, i was able to get
    > the routine to work!
    >
    > I can't thank you enough for your help!
    >
    > Best wishes
    >
    > James Currer
    >
    > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > news:<ey2VxX$dDHA.2680@TK2MSFTNGP11.phx.gbl>...
    >> I've created a Stored Procedure Code Generator tool which you can
    >> find here:
    >>
    [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp&c=&a=clear[/url]
    >>
    >> You will need to define the ADO constants used by the generated
    >> code. You
    >> can do that by using #include to include the adovbs.inc file which
    >> you can
    >> locate in ...\Program Files\Common Files\System\ADO. A better way is
    >> described here: [url]http://www.aspfaq.com/show.asp?id=2112[/url]
    >>
    >> HTH,
    >> Bob Barrows
    >>
    >>
    >> James Currer wrote:
    >>> cmdImportBook.Parameters.Append
    >>> cmdImportBook.CreateParameter("@p_placepubdate", 203,
    >>> 1,16,cmdImportBook__p_placepubdate)
    >>>
    >>> The string being inserted into the field (contained in variable
    >>> cmdImportBook__p_placepubdate) is as follows:
    >>>
    >>> "1972. International Geological Congress. First. Book - VG,
    >>> softback.
    >>> 6.5x9. 446pp. Many b&w illus."
    >>>
    >>> and the relevant stored procedure parameter code:
    >>>
    >>> @p_placepubdate ntext
    >>>
    >>> I have declared this parameter last in the SQL, and last in the ADO
    >>> parameter list. I have also tried moving the parameter about in the
    >>> ADO parameter declaration list, to no avail.
    >>>
    >>> Thank you in advance for any additional help you could provide.
    >>>
    >>> James Currer

    Bob Barrows Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139