Cannot use parentheses when calling a Sub (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


seth -> Cannot use parentheses when calling a Sub (4/4/2006 12:22:02)

This error is driving me CraZy, any ideas

Microsoft VBScript compilation error '800a0414'

Cannot use parentheses when calling a Sub

/admin_test/viewLists.asp, line 263

Response.Write(Replace(objRS("FirstName")),"'","''") & " " & (Replace(objRS("LastName")),"'","''"))






Spooky -> RE: Cannot use parentheses when calling a Sub (4/4/2006 12:34:00)

Your brackets are a bit out of place :

  Response.Write (Replace(objRS("FirstName"), ",", "") & " " & Replace(objRS("LastName"), ",", ""))




seth -> RE: Cannot use parentheses when calling a Sub (4/4/2006 12:53:28)

hey wait a second, i want to be dealing with apostrophies not commas in the name fields,


blah2 = (Replace(objRS("LastName")), "'", "''")


but i getting error:
Expected ')'

blah2 = (Replace(objRS("LastName")), "'", "''")





Spooky -> RE: Cannot use parentheses when calling a Sub (4/4/2006 13:02:16)

Same answer - get your brackets in the right place!




rdouglass -> RE: Cannot use parentheses when calling a Sub (4/4/2006 14:04:50)

quote:

blah2 = (Replace(objRS("LastName")), "'", "''")


Look closely at this one:

blah2 = Replace(objRS("LastName"), "'", "''")

The replace function syntax is like this:

Replace (stringToSearch,stringToSearchFor,replacementString)

stringToSearch = objRS("LastName")
stringToSearchFor = "'"
replacementString = "''"

That any clearer?




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875