Hi I get this error Microsoft VBScript compilation error '800a03ee' Expected ')' /new/MaintainCat.asp, line 10 Response.Redirect ("MaintainCat_2.asp?CatCode=<%= rstCatItems("CatCode")) " ---------------------------------------------------------------^ This is the code. Can I ask what is incorrect, and perhaps a correction to the syntax please. TIA If Session("AdminPriveledges") = False Then Response.Redirect ("default_2.asp?CatCode=<%= rstCatItems("CatCode")) " Code (markup):
If Session("AdminPriveledges") = False Then Response.Redirect ("default_2.asp?CatCode=" & rstCatItems("CatCode")) Code (markup):
Thanks for your replies. I tried something similar but Type mismatch error, the same with Mano's snippet.
Yes, I think it is. I'll take a look at it later, at home!.... CatCode is being used for soemthing else I think
type mismatch most likely means you're trying to compare apples to oranges, i.e. you're trying to match up a text string with a numeric field. i would verify that you're not doing that, and if you're trying to compare numbers to numbers and still getting the error, try doing a string convert i.e. newcatcode = cNum(catcode)
Thanks a lot..Ok, heres the code - some non essential bits. Firstly: - CatCode is the primary key column, data type = text <a class="cataitems" href="default.asp?CatCode=<%= rstCatItems("CatCode") %> Code (markup): ...works fine, in that the URL based on the catcode is written and functions. When a user requests a records, if they have no logged, then they are redirected to an alternative page. Dont ask!:-D ===============================CODE----------------- <% Option Explicit Response.Expires = 0 Response.Buffer = True If Session("AdminPriveledges") = False Then Response.Redirect ("default_2.asp?CatCode=" & rstCatItems("CatCode")) End if %> '============================== <% Dim cnnCatalogue, rstCatItems, fsoFile Dim strSQL Dim strCatCode, strCatDescription Dim intcatPack, curCatUnitPrice Dim strCatNotes Dim strCatCurrency %> '============================= Set cnnCatalogue = Server.CreateObject("Conn") ==== conn is just something ive put there temp strConn = "DSN=me;UID=me;PWD=me" cnnCatalogue.Open strConn ' Create recordset object... Set rstCatItems = Server.CreateObject("ADODB.Recordset") ' Create filesystem object... Set fsoFile = Server.CreateObject("Scripting.FilesystemObject") If Len(Request.QueryString("CatCode")) > 0 Then ' A catcode has been supplied... strCatCode = Trim(Request.QueryString("CatCode")) rstCatItems.CursorLocation = adUseServer rstCatItems.CursorType = adOpenKeyset rstCatItems.LockType = adLockOptimistic strSQL = "SELECT * FROM CatItems WHERE CatCode='" & strCatCode & "'" rstCatItems.Open strSQL, cnnCatalogue If Not rstCatItems.BOF and Not rstCatItems.EOF Then ' Retrieve row from the recordset... rstCatItems.MoveFirst If Len(Request.QueryString("CatAction")) > 0 Then ' An action has been supplied... Select Case Request.QueryString("CatAction") Case "Update" ' Update catalogue item... strCatDescription = Trim(Request.Form("CatDescription")) intcatPack = CInt(Request.Form("catPack")) strCatCurrency = Trim(Request.Form("CatCurrency")) curCatUnitPrice = CCur(Request.Form("CatUnitPrice")) strCatNotes = Trim(Request.Form("CatNotes")) rstCatItems("CatCode") = strCatCode rstCatItems("CatDescription") = strCatDescription rstCatItems("catPack") = 1 rstCatItems("CatCurrency") = strCatCurrency rstCatItems("CatUnitPrice") = curCatUnitPrice rstCatItems("CatNotes") = strCatNotes rstCatItems.Update Response.Write "blah blah<br><br>" Case "Delete" ' Delete catalogue item... rstCatItems.Delete Response.Write "blah blah<br><br>" End Select Else ' Display catalogue item... strCatCode = rstCatItems("CatCode") strCatDescription = rstCatItems("CatDescription") intcatPack = rstCatItems("catPack") strCatCurrency = rstCatItems("CatCurrency") curCatUnitPrice = rstCatItems("CatUnitPrice") strCatNotes = rstCatItems("CatNotes") %> '============================= Code (markup):
in place of Response.Redirect ("default_2.asp?CatCode=" & rstCatItems("CatCode")) try this Response.Redirect "default_2.asp?CatCode=" & rstCatItems("CatCode") was the error here or on some other line, please highlight it
Hi Yes the error occured on the same line. I'll try it out. I think this might solve the problem though. Let me explain: - display page with listing, when the user clicks a link, a popup window shows with further details on that products. I think it might be somethign to so with that fact the the previous method did not have any variable to compare or evaluate? TIA Option Explicit Response.Expires = 0 Response.Buffer = True Dim tmpCat tmpCat = Request.QueryString("CatCode") If Session("AdminPriveledges") = False Then Response.Redirect ("default_2.asp?CatCode=" & tmpCat) Code (markup): End if
hi, yes that idea solved the problem, and it passed on the variable almost without problem. Now it seems that there is a problem with map path, and server vars Script Name, aarrrhhh - since the images don't display. But, the above did solve the problem.... cheers
="http://forums.digitalpoint.com/showthread.php?t=137681" Hi yes, it has been sorted, I will test it later. Thanks a lot for your help