Retrieving text from SQL Server

Results 1 to 2 of 2

Thread: Retrieving text from SQL Server

  1. #1
    Mark Holland Guest

    Default Retrieving text from SQL Server

    Hi,<BR><BR>I&#039m using the text data type in SQL server to store some pretty big text data (resumes) but I can&#039t seem to get an ASP page to Store or Retrieve the data they contain. I&#039ve loked all over the net but I cant find any articles that refer to SQL Server and ASP. <BR><BR>If anyone knows of a page or could help me out here I would really appreciate it.<BR><BR>Thanks in advance,<BR><BR>Mark Holland

  2. #2
    CPeinado Guest

    Default RE: Retrieving text from SQL Server

    Keep in mind I have NEVER tried this, but hope it sheds some light.<BR>Use the Stream object in ADO. It is usually used to handle large chuncks of text from a database or binary data. <BR><BR>You can use this syntax to Open a Stream (text) object from a URL or Record object: <BR>streamobject. Open (Source, Mode, OpenOptions, UserName, Password)<BR><BR>The stream object has a lot of methods that you might want to check out: <BR><BR><BR>For example if you have a webpage with a textarea and you want to populate it with text from another source, you would use something like this:<BR><BR><BR>&#060;TEXTAREA NAME="txtStreamContents"&#062;<BR>&#060;%<BR>Dim stmData<BR><BR>Set stmData = Server.CreateObject("ADODB.Stream")<BR>stmData.Ope n "URL=http://localhost/", adModeRead, _ adOpenStreamFromURL<BR><BR>&#039there is an adOpenStreamFromRecord argument insead of <BR>&#039the adOpenStreamFromURL to open text from a record object.<BR><BR>stmData.Charset = "ascii"<BR>Response.Write stmData.ReadText<BR>stmData.Close<BR>Set stmData = Nothing<BR>%&#062;<BR>&#060;/TEXTAREA&#062; <BR><BR>This example I got from Professional Active Server Pages 3.0 book wrox publications. Hope it helps.<BR>Claudia

Posting Permissions

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