테이블에서 필드를 가져 와서 결과가 무엇인지에 따라 다른 작업을 수행하고 있습니다.ASP 코드가 SQL 필드를 올바르게 읽지 못합니다.
다음The field is: y
가, 나중에, 내가 If 문이 :
<% ElseIf result ="y" or Session("customer_id") <> "" Then
Do Something
%>
을하지만이의 ElseIf 문에 무엇을 실행 결코 여기에 내 코드
<%stringA ="Select field From table Where something=1"
set response = connFW.Execute(stringA)
set result = response ("field")
If result ="y" Then
Response.Write("The field is: " & result)
End If%>
그것은이 출력입니다! 그것은 페이지의 맨 위에 올바른 결과를 주었다고 말합니다! 내가 놓친 게 있니?
참고 : 혼동을 피하기 위해,이 코드는 페이지의 상단에 : 당신이 어딘가에 몇 가지 코드를 떠나는 경우가 아니라면
Set connFW = Server.CreateObject("ADODB.Connection")
connFW.ConnectionTimeout = Application("FW_ConnectionTimeout")
connFW.CommandTimeout = Application("FW_CommandTimeout")
connFW.Open Application("FW_ConnectionString")
ElseIf에 처음으로 만족되는 결과 result = "y"가있는 경우 If 컨트롤이이 줄에 어떻게 올까요? 그래서 ElseIf에 그냥 Session ("consumer_id") <> ""을 넣거나 If 블록에 넣으십시오. – Ravia