Banner Rotation System Article from 4guys- I need

Results 1 to 2 of 2

Thread: Banner Rotation System Article from 4guys- I need

  1. #1
    Join Date
    Dec 1969

    Default Banner Rotation System Article from 4guys- I need

    I have used the files available in the article entitled "Creating a Banner Rotation System" to do just that. It ALMOST works. But it gets stuck when it tries to creat a new text file. Here is the error text:<BR><BR>Microsoft VBScript runtime error &#039 800a0034&#039 <BR><BR>Bad file name or number <BR><BR>/banners/banner.asp, line 113 <BR><BR>and here are some lines of code around line 113:<BR><BR>103: &#039Update impression stats...<BR>104: Dim strPath<BR>105: strPath = path & "clicks\" & banInfo(count,bannerID) & ".txt"<BR>106:<BR>107: Dim impressions<BR>108:<BR>109: if fs.FileExists(strPath) then<BR>110: Set banFile = fs.OpenTextFile(strPath,1)<BR>111: impressions = CInt(banFile.ReadLine)<BR>112: else<BR>113: Set banFile = fs.CreateTextFile(strPath,True)<BR>114: impressions = 0<BR>115: end if<BR>116:<BR>117: impressions = impressions + 1<BR>118:<BR>119: banFile.close<BR><BR>It seems the server can work just fine with the object fs, as it must open and read another text file in this script BEFORE it gets to this point. However, it fails at this point. I realize that there must be a file folder at this point on the server named "clicks" and there is one. Nevertheless, I cannot seem to figure out how to fix this problem!<BR><BR>Help!! <BR><BR>Thanks,<BR><BR>Edward

  2. #2 Guest

    Default RE: Banner Rotation System Article from 4guys- I n

    This comes from a reply I received from Scott Mitchell and it works!:<BR>This is likely caused because you are using vbCrLf and not chr(10) as the<BR>delimiters in your banner.txt file. In banner.asp<BR>(, where it reads:<BR><BR> if right(records(i),1) = chr(10) then<BR> records(i) = left(records(i), len(records(i)) - 1)<BR> end if<BR> if left(records(i),1) = chr(10) then<BR> records(i) = right(records(i), len(records(i)) - 1)<BR> end if<BR><BR>replace the chr(10) with vbCrLf (and replace the chr(10) with vbCrLf throughout this page)<BR><BR>That should do the trick...<BR><BR> Scott Mitchell

Posting Permissions

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