Ir para conteúdo
Fórum Script Brasil

Marcos-rj

Membros
  • Total de itens

    638
  • Registro em

  • Última visita

Posts postados por Marcos-rj

  1. Tenta com essa função:

    Function FormataValor(Valor)
      Dim sp, sv, v
      sp = Mid(FormatNumber(1000, 0, -1, 0, -1),2,1)
      sv = Mid(FormatNumber(0.1, 1, -1, 0, -1),2,1)
      If isNumeric(Valor) Then
        v = FormatNumber (Valor, 2, -1, 0, -1)
      Else
        v = FormatNumber (0, 2, -1, 0, -1)
      End If
      v = Replace(v, sp, "p")
      v = Replace(v, sv, "v")
      v = Replace(v, "p", ".")
      v = Replace(v, "v", ",")
      FormataValor = v
    End Function

    <%=FormataValor(rs("valor"))%>

  2. To tentando conectar com minha base de dados MySQL online. como no delphi7 ficava dando mensagem de unidirecional com o dbexpress e não consegui usar o zeos p/ conectar resolvi instalar o Delphi 2006.

    Mas quanto tento conectar usando o dbexpress acontece o seguinte.

    Configuro o TSqlConnection e conecto. ate ai beleza. funciona legal.

    Ai coloco um TSqlQuery e coloco a sql.

    Select * From Produtos

    ou

    Select nome, preço From Produtos

    Mas está retornando o seguinte erro:

    Invalid Field Type

    alguém sabe dizer o por que disso?

  3. Este código, eu já usei ele. ainda funciona. você pode colocar a extensão que quiser.

    usei em um site que estava montando. www.pscifrao.com.br . pode testar lá. no meu caso coloquei so algumas extenções, mas você pode colocar +.

    <head>
    <%
    '---------------inicio da função que corrige o acento------------------
    Function BinaryToString(strBinary)
    Dim intCount, xBinaryToString
    xBinaryToString =""
    For intCount = 1 to LenB(strBinary)
    xBinaryToString = xBinaryToString & chr(AscB(MidB(strBinary,intCount,1)))
    Next
    BinaryToString = xBinaryToString
    End Function
    '---------------fim da função que corrige o acento---------------------
    
    dominio = request.form("dominio")
    sufixo = request.form("sufixo")
    
    If sufixo = ".com" or sufixo = ".net" or sufixo = ".org" or sufixo = ".biz" or sufixo = ".cc" or sufixo = ".info" or sufixo = ".tv" Then
    url = "http://reports.internic.net/cgi-bin/whois?whois_nic="&dominio&""&sufixo&"&type=domain"
    
    Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
    objXMLHTTP.Open "GET",url, false
    objXMLHTTP.Send
    texto = objXMLHTTP.responsebody
    texto1 = BinaryToString(texto)
    
    If instr(1,texto1,"No match for domain") Then
    msg = "1"
    else
    msg = "2"
    end if
    end if
    
    If sufixo = ".com.br" then
    url = "https://registro.br/cgi-bin/nicbr/whois?qr="&dominio&""&sufixo&" "
    
    Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
    objXMLHTTP.Open "GET",url, false
    objXMLHTTP.Send
    texto = objXMLHTTP.responsebody
    texto1 = BinaryToString(texto)
    
    If instr(1,texto1,"inexistente") Then
    msg = "1"
    ElseIf instr(1,texto1,"encontrada nenhuma") Then
    msg = "2"
    ElseIf instr(1,texto1,"Como fazer uma consulta") Then
    msg = "2"
    ElseIf instr(1,texto1,"Primeiro") Then
    msg = "2"
    Else
    msg = "2"
    End If
    
    end if
    %>        
    <style>
    <!--
     .texto {font: 13px Verdana; text-decoration: none; color: #FFFF00}
    .txt2 {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
    }
    .txt1bold {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
    }
    -->
    </style>
            </head>
    
               <table width="578"><tr><td align="left" valign="top" width="572">
                               <table border="0" cellspacing="4" cellpadding="4" width=577 bgcolor="#FFFFFF"><tr>
                                <td width="561">
                                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td>
                                <b><font face="Arial Black">&nbsp;</font><font color="#000080" face="Verdana" style="font-size: 14pt">BUSCA 
                                        DE DOMÍNIO</font></b></td>
                                    </tr>
                                </table>
                                </td></tr>
                                 <tr><td bordercolor="#008000" width="561"><font style=font-size:11px;color:000000> 
                                    <div align=justify><font style=font-size:11px >
                                        <table border=0 cellspacing=0 width="100%" cellpadding=0>
                                        <tr>
                                            <td height=5>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td height=5>
                                                        <font style="font-size:11px; color:000000" >
                                                        <img border="0" src="img/a1.gif" width="15" height="13"> </font>
                                            <font face="Verdana" size="2">O 
                                            resultado da sua busca para </font>
                                                                <font face="Verdana" style="font-size: 9pt; font-weight:700">
                                                                www.</font><font color="#FF0000" face="Verdana" style="font-size: 9pt; font-weight: 700"><%=dominio%><%=sufixo%></font></td>
                                        </tr>
                                        
                                        <%if msg="1" then%><tr>
                                            <td height=90 valign="bottom">
                                            <p align="center">
                                            <img border="0" src="img/v.gif" width="15" height="15">
                                            <b>
                                            <font face="Verdana" size="2" color="#008000">
                                            Domínio Disponível</font></b></p>
                                            <div align="center">
                                                <table border="0" width="370" id="table2" height="28" style="border: 1px solid #E5E5E5" cellspacing="0" cellpadding="0">
                                                <tr >
                                                    <td width="183" align="center" onmouseover="this.style.background='#CCFFCC';window.status='REGISTRA DOMÍNIO';return true;" onmouseout="this.style.background='';window.status='';return true;">
                                                    <font face="Verdana" style="font-size: 9pt">
                                                    REGISTRAR DOMÍNIO</font></td>
                                                    <td width="183" align="center" onmouseover="this.style.background='#CCFFCC';window.status='REGISTRAR E HOSPEDAR';return true;" onmouseout="this.style.background='';window.status='';return true;" style="border-left: 1px solid #E5E5E5">
                                                    <font face="Verdana" style="font-size: 9pt">
                                                    REGISTRAR E HOSPEDAR</font></td>
                                                </tr>
                                            </table>
                                            </div>
                                            <hr color="#000000" size="1"></td>
                                            
                                        </tr><%end if%>
                                        <%if msg="2" then%><tr>
                                            <td height=5>
                                            <p align="left" style="margin-top: 0; margin-bottom: 8px">
                                            <font style="font-size:11px; color:000000" >
                                            <img border="0" src="img/x.gif" width="15" height="15">
                                            <b>
                                            <font face="Verdana" size="2" color="#FF0000">
                                            Domínio Registrado</font></b></font></p>
                                            <p align="center" style="margin-top: 0; margin-bottom: 5px">
                                            <span class="txt1bold"><strong>
                                            <font size="2">Caso você 
                                            seja o proprietário deste domínio e 
                                            queira hospedá-lo na PSCIFRÃO:</font></strong></span></p>
                                            <font style="font-size:11px; color:000000" >
                                            <div align="center">
                                                <table border="0" width="254" id="table3" height="28">
                                                <tr >
                                                    <td width="246" align="center" onmouseover="this.style.background='#CCFFCC';window.status='REGISTRA DOMÍNIO';return true;" onmouseout="this.style.background='';window.status='';return true;" style="border: 1px solid #CFCFCF">
                                                    <font style="font-size:9pt; color:000000" face="Verdana" >
                                                    CLIQUE AQUI</font></td>
                                                </tr>
                                            </table>
                                            </div>
                                            <hr color="#000000" size="1">
                                    </font></td>
                                        </tr><%end if%>
                                        <tr>
                                            <td height=5>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td height=5>
                                            <font style="font-size:11px; color:000000" >
                                            <form method="POST" action="busca_dominio.asp">
                                                <table border="0" width="99%" id="table4" cellspacing="0" cellpadding="0" style="border: 1px solid #000000" height="60" bgcolor="#E5E5E5">
                                                    <tr>
                                                        <td height="20">
                                                        <p align="left">
        <font face="Verdana"><b class="txt_titulo"><font size="2" color="#FF0000">&nbsp;•
        </font><font color="#FF0000"><span style="font-size: 8pt">VERIFICAR OUTRO 
        DOMÍNIO</span></font></b></font></td>
                                                    </tr>
                                                    <tr>
                                                        <td height="28">
                                                        <p align="center">
            <font face="Verdana"><span style="font-size: 9pt">Domínio: www.</span><span style="font-size: 8pt">
    <input type="text" name="dominio" value="" size="28" maxlength="59" style="border: 1px solid #000000">
            . 
            <select name="sufixo" size="1">
    <option value=".biz">biz</option>
    <option value=".can.br">can.br</option>
    <option value=".cc">cc</option>
    <option value=".com">com</option>
    <option value=".com.br" selected>com.br</option>
    <option value=".info">info</option>
    <option value=".net">net</option>
    <option value=".org">org</option>
    <option value=".tv">tv</option>
    </select>&nbsp;&nbsp; <input type="submit" value="buscar" style="font-size: 8pt"></span></font></td>
                                                    </tr>
                                                    <tr>
                                                        <td height="14">
                                                        <span style="font-size: 5pt">&nbsp;</span></td>
                                                    </tr>
                                                </table>
                                            </form>
                                    </font></td>
                                        </tr>
                                        <tr>
                                            <td height=5>
                                                        </td>
                                        </tr>
                                        <tr>
                                            <td height=5>
                                            <hr size="1" color="#ECE9D8" width="80%">
                                            </td>
                                        </tr></table>
                                    </font></font>
                                    <font style=font-size:11px;color:000000>
                                    <font style=font-size:11px face=Verdana><center>
                                    <a style="text-decoration: none" onMouseOut="window.status='';return true;" onMouseOver="window.status='Página Inicial';return true;" href="java script:history.back(1)">:: 
                                    <b>Voltar</b> ::</a></center></td></tr>
                             </table></td></tr>
             </table>

    Fique a vontade para modificar.

  4. Bom vamos lá.

    O VBScript possui dois tipos de sub-rotinas: Sub e Function.

    As procedures Sub são blocos de códigos iniciados pela palavra Sub e encerrados por End Sub.

    é um conjunto de comandos associados a um identificador alfanumérico.

    Uma Function possui a mesma definição. só que alem de executar os comandos associados a ela, pode gerar um valor como resultado. ao contrario da Sub que não retorna valor em sua chamada.

    Sintaxes:

    Sub NomeDoProcedimento([Parâmetro(s)])
    
    Comando(s)
    
    End Sub
    --------
    Function NomeDaFunção([Parâmetro(s)])
    
    Comando(s)
    
    End Function
    Exemplo: Função: Formata Nome ------------------------------------- <% Function FormataNome(Nome) aNome = Split(Nome) For i = LBound(aNome) To UBound(aNome) if Len(aNome(i)) > 0 Then nNome = nNome&" "& UCase(Mid(aNome(i),1,1)) & LCase(Mid(aNome(i),2)) End If Next FormataNome = Trim(nNome) End Function %> Aqui como Chamar a Função <%=FormataNome(" MaRcOs FeRnAnDeS ")%> -------------------------------------
    Função: Soma
    <%
    Function soma(a,b)
    Dim Resultado
    resultado = a + b
    soma = resultado
    End Function
    Dim c,d,e
    Response.Write soma(10,20)
    %>

    Qualquer coisa posta ai, tenho que sair agora. Espero ter ajudado.

  5. tenta assim:

    <%dim vcategoria

    vcategoria=trim(request.form("categoria"))

    insere="insert into categoria (categoria) values ('" & vcategoria & "')"

    response.write insere

    'response.end

    set con = server.CreateObject("adodb.connection")

    con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tulio\cowhorse\cowclientas.mdb;Persist Security Info=False"

    con.execute(insere)%>

×
×
  • Criar Novo...