If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > How to store large text-strings in a sql-field?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-28-03, 09:56
alshadar alshadar is offline
Registered User
 
Join Date: Nov 2003
Location: Norway
Posts: 6
How to store large text-strings in a sql-field?

I will store text with more than 8.000 characters in a sql-database. I defined my field as data-type=text. But when I paste a large text string into the database, only some of the text is being saved. The text also changes to "<long text> so I can't change it.

I tried to make some asp-code to handle the problem, but I can't find the right constants to use according to the data-type=text. In my example I use the constant "adBinary".

strInfo = Request.Form("txtInfo")
Set cmd = Server.CreateObject("ADODB.Command")
With cmd
.ActiveConnection = MyConn
.CommandText = "add_Info"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter ("@Info", adBinary, adParamInput, , strInfo)
.Execute lngRecs, , adExecuteNoRecords
Set cmd = Nothing
End With

Is there anybode that can help me?
Reply With Quote
  #2 (permalink)  
Old 11-28-03, 11:04
shelva shelva is offline
Registered User
 
Join Date: Nov 2003
Location: Rotterdam, Netherlands
Posts: 127
I think you are using SQL-SERVER,
First check the maximum size allowed in TEXT type of Field.

I doubt if it can allow so many characters.
Reply With Quote
  #3 (permalink)  
Old 12-02-03, 03:10
alshadar alshadar is offline
Registered User
 
Join Date: Nov 2003
Location: Norway
Posts: 6
I found the solution. In the asp-code, I use datatype "varchar" and number of characters like 2147483647.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On