urgent - putting text, with ', " and & into th

Results 1 to 3 of 3

Thread: urgent - putting text, with ', " and & into th

  1. #1
    Curtis Batt Guest

    Default urgent - putting text, with ', " and & into th

    This is a tough one, I think.<BR><BR>I have a lot of fields on a web form and I want to avoid using Replace() on the incoming fields 3 times to check for the nasty single quote (&#039), double quote (") or ampersand (&).<BR><BR>I am building an ADO Command object and loading it with the parameters then executing the command object vs. a stored procedure.<BR><BR>The stored procedure expects one of the fields to be of type "text". The database is SQL Server 7 running on Win2K.<BR><BR>In ADO, how do I specify that the parameter is of type text, not VarChar, not Variant... TEXT! I can&#039t seem to figure this out and I&#039m already thinking of simply converting the "text" field to a huge VarChar and simply dropping the lost characters, but I feel that this is an inelegant solution.<BR><BR>Any help would be appreciated.

  2. #2
    Join Date
    Dec 1969

    Default Why avoid Replace()????

    the simplest solution is the best solution 99.9% of the time<BR><BR>j

  3. #3
    Joey Guest

    Default RE: urgent - putting text, with ',

    If you are using the Parameters collection and need to pass a text field into a Stored procedure do it like below.<BR><BR>.Parameters.Append .CreateParameter("@Description", adVarChar, adParamInput, 2147483647, Description)

Posting Permissions

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