Estou com uma dúvida que julgo ser muito idiota, pois sou programador a muito tempo, mas fiquei um ano sem programar e to tendo muita dificuldade nisso.
Acontece o seguinte:
Eu tenho essa página ASP, que busca informações no BD, a página funciona corretamente, porém quero fazer um IF que veja se o campo RESPONSAVEL no BD estiver vazio ele não escreve nada.
Valeu, Galera!!!!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <style type="text/css"> <!-- .style10 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; } .style11 { font-family: Verdana, Arial, Helvetica, sans-serif; color: #006666; font-weight: bold; font-size: 15px; } body { background-color: #EEEEEE; } a:link { color: #006666; } a:visited { color: #006666; } a:hover { color: #006666; } a:active { color: #006666; } --> </style> <%id= request.QueryString("id")%> <% Dim DB set DB = Server.CreateObject("ADODB.Connection") DB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("../data/db_site.MDB") DB.mode = adModeRead DB.open Set rs = DB.Execute("SELECT * FROM casa_noturna WHERE id = "&id) %> <table width="600" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000"> <tr> <td bgcolor="#eeeeee"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCFF00"> <tr> <td valign="top"><table width="100%" height="10" border="0" cellpadding="0" cellspacing="0"> <tr> <td></td> </tr> </table> <table width="598" height="100" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="9" height="100"></td> <td width="170"><img src="imagens/<%=rs.fields("logo")%>" width="170" height="100"></td> <td width="9"></td> <td width="398" align="left" valign="top"><span class="style11"><strong><%=rs.fields("estabelecimento")%></strong></span><br> <span class="style10"><%=rs.fields("endereco")%> - <%=rs.fields("bairro")%><br> (<%=rs.fields("ddd")%>) <%=rs.fields("tel1")%> | (<%=rs.fields("ddd")%>) <%=rs.fields("tel2")%><br> <%=rs.fields("cidade")%> - <%=rs.fields("estado")%></span> </td> <td width="12"> </td> </tr> </table> <table width="100%" height="10" border="0" cellpadding="0" cellspacing="0"> <tr> <td></td> </tr> </table></td> </tr> </table> <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"> <tr> <td></td> </tr> </table> <table width="598" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="10" height="19"> </td> <td width="578"><span class="style10"><%=rs.fields("sobre")%> <br> [COLOR=red]<%if rs.fields("responsavel") = "" then%> <%else%> <strong>Responsável:</strong> <%=rs.fields("responsavel")%> <br> <%end if%>[/COLOR] <strong>Site:</strong> <a href="<%=rs.fields("site")%>"><%=rs.fields("site")%></a> <br> <strong>Email:</strong> <a href="mailto:<%=rs.fields("email")%>"><%=rs.fields("email")%></a> <br> <strong>Capacidade:</strong> <%=rs.fields("capacidade")%><br> <strong>Ambientes:</strong> <%=rs.fields("ambientes")%></span> </td> <td width="10"> </td> </tr> </table> </td> </tr> </table> <% rs.Close SET rs = NOTHING SET DB = NOTHING %> </body> </html>
Edição feita por: Brunao, 08/07/2005, 12:22.