[thelist] VBScript/ASP string concatenation problem

Brian Cummiskey Brian at hondaswap.com
Wed Jul 27 12:24:42 CDT 2005


Pringle, Ron wrote:


> fsPath= "documents/aldermen/agendas/" &
> Year(DetailsRecordSet.Fields.Item("eventDate").Value) & "/" &
> Details.RecordSet.Fields.Item("committeeCode").Value &
> fncFmtDate((DetailsRecordSet.Fields.Item("eventDate").Value), "%b%d%Y") &
> "agd.pdf"
> 
> The above returns an Object required: " error.
> 
> I understand why its generating the error but not how to properly
> contatenate the strings and values together. Any help or pointers to
> documentation or how-tos on the web would be greatly appreciated.

Ron, break it out.  it will make life much easier.

------------------


dim eventDate, eventYear, comitteeCode

eventDate = 
fncFmtDate((DetailsRecordSet.Fields.Item("eventDate").Value), "%b%d%Y")
eventYear = Year(DetailsRecordSet.Fields.Item("eventDate").Value)
comitteeCode = Details.RecordSet.Fields.Item("committeeCode").Value


fsPath= "documents/aldermen/agendas/" & eventYear & "/" &
committeeCode & eventDate & "agd.pdf"



so, upon easy looking...  is there supposed to be a / between the 
comitteeCode and the eventDate:

fsPath= "documents/aldermen/agendas/" & eventYear & "/" &
committeeCode & "/" & eventDate & "agd.pdf"


basicaly, the error means it can't find the path, thus can't open the 
file (assuming the file exists)...  so make sure the path does exist, 
and that the rst executes properly, thus leaving you a proper path.  try 
printing out the variables as well...  make sure that they populate what 
they are supposed to in order to create the proper URI


HTH



More information about the thelist mailing list