Prev: I see my chosen background in front page but I can't select it
Next: Downloading Entire Webpage
From: Markus on 15 Jan 2010 03:36 Hallo I hope some one can help me i have problem with the following code it sometimes works and sometimes it does not. Basicly what it does it looksup a User ID in a table CDS that needs to match the string cdsid and if it matches keep loading the page if they do not match go do the redirect some some casses it works fine but then i have casses where it does not work even do the User-ID is in the table. <% Dim rs2, strPfadDB2, SQL2 strPfadDB2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath("\fpdb\CDS_Table.mdb") & _ ";Mode=ReadWrite;Persist Security Info=False" SQL2 ="SELECT CDS.CDSID " & _ "FROM CDS " & _ "WHERE CDS.CDSID='" & cdsid & "'" set rs2 = Server.CreateObject("ADODB.Recordset") rs2.Open SQL2, strPfadDB2, 1, 2 IF NOT rs2.eof then else response.redirect ("WERSAuditE.asp") end if rs2.Close set rs2 = nothing %>
From: Stefan B Rusynko on 15 Jan 2010 04:15 Where and how are you getting the value for: cdsid From a form or query string - and are you preprocessing it to make sure it is a text string Also if it is text, it is case sensitive so try "WHERE Lcase(CDS.CDSID)='" & Lcase(cdsid) & "'" -- _____________________________________________ SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] "Warning - Using the F1 Key will not break anything!" (-; _____________________________________________ "Markus" <Markus(a)discussions.microsoft.com> wrote in message news:A75FD62B-12E0-4AF0-A8FC-70073EFC2399(a)microsoft.com... Hallo I hope some one can help me i have problem with the following code it sometimes works and sometimes it does not. Basicly what it does it looksup a User ID in a table CDS that needs to match the string cdsid and if it matches keep loading the page if they do not match go do the redirect some some casses it works fine but then i have casses where it does not work even do the User-ID is in the table. <% Dim rs2, strPfadDB2, SQL2 strPfadDB2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath("\fpdb\CDS_Table.mdb") & _ ";Mode=ReadWrite;Persist Security Info=False" SQL2 ="SELECT CDS.CDSID " & _ "FROM CDS " & _ "WHERE CDS.CDSID='" & cdsid & "'" set rs2 = Server.CreateObject("ADODB.Recordset") rs2.Open SQL2, strPfadDB2, 1, 2 IF NOT rs2.eof then else response.redirect ("WERSAuditE.asp") end if rs2.Close set rs2 = nothing %>
|
Pages: 1 Prev: I see my chosen background in front page but I can't select it Next: Downloading Entire Webpage |