Ir para conteúdo
Fórum Script Brasil
  • 0

Pequena Dúvida


ramses

Pergunta

Refaço o tópico pois talvez não tenha me fazido entender: Tento fazer dois scripts em ASP para montar um formulário que servirá para o usuário inserir dados. Alguns dos campos entretanto já estarão pré-preenchidos através de dados resgatados de uma tabela de um Banco de Dados ACCESS. Os parâmetros são definidos em um formulário anterior e retornados através de uma instrução request. O objetivo disto é para que os campos PROCESSO, NOME e ENDEREÇO (no SCRIPT 1) já estejam pré-prenchidos quando o usuário for inserir os dados complementares. A busca funciona só que, só consigo resgatar a primeira palavra de cada campo e não o campo inteiro. Por exemplo Só que so consigo buscar a primeira palavra de cada campo. Por exemplo, no campo DENUNCIADO, se está cadastrado "JOSÉ DA SILVA SANTOS" eu só consigo buscar "JOSÉ". Se no campo ENDER está cadastrado "RUA DAS ALELUIAS, 113", o formulário só retorna "RUA" e assim por diante... Posto os scripts abaixo, informando que o no SCRIPT 1, "PROCESSO" é um campo alfa-númérico e no SCRIT 2, "Cod1" é um campo numérico. Obrigado!

SCRIPT 1

<%@ CodePage=1252 Language="VBScript"%>
<% Option Explicit %>
<!-- #INCLUDE file="FCKeditor/fckeditor.asp" -->
<!--#Include file="../dbConex.inc"-->
<%
DIM conexaoDataBase, x, cod
cod = request.querystring("cod")
DIM sqlPrinc, rsPrinc, estilo
Call AbreConexao
sqlPrinc = "SELECT * "
SQLPrinc = sqlPrinc + "FROM TabelaPRINCIPAL WHERE PROCESSO = '" +cod+ "' "
Set rsPrinc = conexaoDataBase.Execute(sqlPrinc)
%>
<html>
<head>
<%If not rsPrinc.eof then%>
<title>Processo</title>
<title>DESPACHO</title>
</head>
<body>
<p><b><font size="6">PROCESSO <% = rsPrinc("PROCESSO") %></font></b></p>

<form name="formdespacho" method="POST"
ACTION="respnova.asp"onSubmit="return validaForm(this);">
<table border="0" cellpadding="0" cellspacing="0" width="100%">

<tr>
<td> PROCESSO: </td>
<td><input type="text" value=<% = rsPrinc("PROCESSO") %> name="processo" size="0"> 
<td width="20%"> FISCAL: </td>
<td width="80%"><input type="text" value=<% = Session("lgn") %> name="FISCAL" size="10"></tr>&nbsp;&nbsp;
</tr>
<tr>
<td>NOME: </td>
<td><input type="text" value=<% = rsPrinc("DENUNCIADO") %> name="denunciado" size="60"></td>
<tr/>
<td width="20%">ENDEREÇO: 
<td width="80%"><input type="text" value=<% = rsPrinc("ENDER") %> name="ender" size="60"></td>

<input type="submit" value="Inserir" name="btInsere">
<input type="reset" value="Limpar campos" name="btLimpa">

<a href="DESPACHAR.asp" class="link"> INICIAL </a>&nbsp;&nbsp;&nbsp;&nbsp;

<a href="Imprimindo1.asp" class="link"> IMPRIMIR OU ALTERAR DESPACHOS</a>
</td>
</tr>

<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/FCKeditor/"
oFCKeditor.Create "FCKeditor1"
%>

</table>
</form>
</body>
</html>
<%end if%>

<%
rsPrinc.Close
Call fechaConexao
Set rsPrinc = Nothing
%>

SCRIPT 2
<%@ CodePage=1252 Language="VBScript"%>
<% Option Explicit %>
<!-- #INCLUDE file="FCKeditor/fckeditor.asp" -->
<!--#Include file="../dbConex.inc"-->
<%
DIM conexaoDataBase, x, cod
cod = request("cod")
DIM sqlPrinc, rsPrinc, estilo
Call AbreConexao
sqlPrinc = "SELECT * FROM DENUNCIA WHERE Cod1 ="+cod
Set rsPrinc = conexaoDataBase.Execute(sqlPrinc)
%>
<html>
<head>
<%If not rsPrinc.eof then%>
<title>Responder Denúncia</title>
<title>DESPACHO</title>
</SCRIPT>
</head>
<body>
<table>
<p><b><font size="6"> DENUNCIA Nº <% = rsPrinc("Cod1") %></font></b></p>
<form name="formdespacho" method="POST"
ACTION="insrespden1.asp" onSubmit="return validaForm(this);">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="20%"> DENUNCIA Nº: </td>
<td width="80%"><input type="text" value=<% = rsPrinc("Cod1") %> name="Cod1" size="0"> 
<td width="20%"> FISCAL: </td>
<td width="80%"><input type="text" value=<% = Session("lgn") %> name="FISCAL" size="10"></tr>&nbsp;&nbsp;
<tr>
<td width="20%">NOME: </td>
<td width="80%"><input type="text" value=<% = rsPrinc("DENUNCIADO") %> name="denunciado" size="40"></td>
<tr/>
<tr>
<td width="20%">ENDEREÇO: 
<td width="80%"><input type="text" value=<% = rsPrinc("ENDER") %> name="ender" size="40"></td>

<td width="20%">NÚMERO: 
<td width="80%"><input type="text" value=<% = rsPrinc("NUM") %> name="num" size="10"></td></tr>
<tr>
<td width="20%">COMPLEMENTO: 
<td width="80%"><input type="text" value=<% = rsPrinc("comp") %> name="comp" size="30"></td>
<td width="20%">BAIRRO: 
<td width="80%"><input type="text" value=<% = rsPrinc("Bairro") %> name="Bairro" size="20"></td> </br>
</tr>
<tr>
<td width="20%">ASSUNTO: 
<td width="80%"><input type="text" value=<% = rsPrinc("Assunto") %> name="Assunto" size="30"></td>
<td width="20%">ORIGEM: 
<td width="80%"><input type="text" value=<% = rsPrinc("Origem") %> name="Origem" size="20"></td>
<td width="20%">DOC: 
<td width="80%"><input type="text" value=<% = rsPrinc("Doc") %> name="Doc" size="10"></td> </br>
</tr>
<tr>
<td width="20%">DENÚNCIA: 
<td width="80%"><input type="text" value=<% = rsPrinc("Denuncia") %> name="Denuncia" size="40"></td>


<input type="submit" value="Inserir" name="btInsere">
<input type="reset" value="Limpar campos" name="btLimpa">

<a href="DESPACHAR.asp" class="link"> INICIAL </a>&nbsp;&nbsp;&nbsp;&nbsp;

<a href="Denunciasresp.asp" class="link"> IMPRIMIR OU ALTERAR RESPOSTAS</a>
</tr>
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/FCKeditor/"
oFCKeditor.Create "FCKeditor1"
%>
</table>
</form>
</body>
<%end if%>

<%
rsPrinc.Close
Call fechaConexao
Set rsPrinc = Nothing
%>

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...