Server varible to big for access database - how to shorten?

Results 1 to 2 of 2

Thread: Server varible to big for access database - how to shorten?

  1. #1
    Mark Clawson Guest

    Default Server varible to big for access database - how to shorten?

    I am using rs("HttpRefer") = CStr(Request.ServerVariables("HTTP_REFERER")) and putting it in an access database. I get an error when the variable is more than 50 characters. How do I limit the string length?<BR><BR>Thanks in advance!

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Server varible to big for access database - how to shorten?

    You can use the Left VBScript function to just take the first 50 characters (http://help.activeserverpages.com/iishelp/VBScript/htm/vbs147.htm).<BR><BR>Instead of rs("HttpRefer") = CStr(Request.ServerVariables("HTTP_REFERER")), use:<BR><BR>rs("HttpRefer") = Left(CStr(Request.ServerVariables("HTTP_REFERER")) , 50)<BR><BR>Another option is to go into Access and make the size of the Text field larger.

Posting Permissions

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