Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

lezão

como fazer enviar um texto de imagem para um mdb

Recommended Posts

Ai galera estou tentando fazer um mdb para cadastrar produtos.

Só q a imagem vai para o diretorio, mas o mdb naun captura o texto da imagem.

 

 

 

Alguem se interessar em me ajudar me add leandro.sowza@hotmail.com

Compartilhar este post


Link para o post
Compartilhar em outros sites

como esta tentando inserir?

Compartilhar este post


Link para o post
Compartilhar em outros sites

está usando que componente para fazer o upload da imagem?

acho q é sem componentes eu acho ?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Poste o código.

Compartilhar este post


Link para o post
Compartilhar em outros sites

assim não fica nada fácil, tem qual tipo de conhecimento em ASP você? conhece o componente que vai usar, já tem o código, ainda procura??

Compartilhar este post


Link para o post
Compartilhar em outros sites

Como esta o trecho de codigo que insere no db?

Compartilhar este post


Link para o post
Compartilhar em outros sites

assim não fica nada fácil, tem qual tipo de conhecimento em ASP você? conhece o componente que vai usar, já tem o código, ainda procura??

 

Este script é do ( insert.asp )...............................................................................

..............................................................................

 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>SISTEMA DE UPLOAD DE QUALQUER ARQUIVO</title>
</head>
<body>

  <form method=POST ENCTYPE="multipart/form-data" action="../cadastro/cad.asp">
	<table>
	  <col width="64" span="3" style="width:48pt">
	  <tr height="17" style="height:12.75pt">
		<td height="17" width="64" style="height:12.75pt;width:48pt"><font size="1" face="Verdana">Nome:</font></td>
		<td width="64" style="width:48pt"><input type="text" name="txtnome" size="20" style="font-family: Verdana; font-size: 10 px; border-style: solid; border-width: 1px"></td>
		<td width="64" style="width:48pt"></td>
	  </tr>
	  <tr height="17" style="height:12.75pt">
		<td height="17" style="height:12.75pt"><font size="1" face="Verdana">Imagem:</font></td>
		<td> <input type="file" name="File1" size="20" style="font-family: Verdana; font-size: 10 px; border-style: solid; border-width: 1px"></td>
		<td></td>
	  </tr>
	  <tr height="17" style="height:12.75pt">
		<td height="17" style="height:12.75pt"><font size="1" face="Verdana">Valor:</font></td>
		<td><input type="text" name="txtpreco" size="20" style="font-family: Verdana; font-size: 10 px; border-style: solid; border-width: 1px"></td>
		<td></td>
	  </tr>
	  <tr height="17" style="height:12.75pt">
		<td height="17" style="height:12.75pt"><font size="1" face="Verdana">Descrição:</font></td>
		<td></td>
		<td></td>
	  </tr>
	  <tr height="17" style="height:12.75pt">
		<td height="17" style="height:12.75pt" colspan="3"><textarea rows="6" name="txtdescricao" cols="46" style="font-family: Verdana; font-size: 10 px; border-style: solid; border-width: 1px"></textarea></td>
	  </tr>
	  <tr height="17" style="height:12.75pt">
		<td height="17" style="height:12.75pt"></td>
		<td></td>
		<td></td>
	  </tr>
	  <tr height="17" style="height:12.75pt">
		<td height="17" style="height:12.75pt"></td>
		<td>
	<input type="submit" Name="Action" value="Adicionar produto">
		</td>
		<td></td>
	  </tr>
	</table>
	<br>
  </form>
</body></HTML>

<!---#INCLUDE FILE="upload.inc" --->

<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then 'Request method must be "POST" For get the fields
  Set Fields = GetUpload()

'ALTERE A PASTA CHAMADA "imgs" PELA PASTA QUE VOCÊ QUER DEIXAR AS IMGENS 
'LEMBRANDO QUE DEVE ESTAR NO MESMO DIRETORIO DAS PAGINAS UPLOAD.ASP E UPLOAD.INC
'DEIXE A BARRA "/" - PARA USAR NO SEU SITE
'DEIXE A BARRA "\" - PARA USAR NA SUA INTRANET

  FilePath = Server.MapPath("Produtos") & "/" & Fields("File1").FileName
  Fields("File1").Value.SaveAs FilePath
End If

%>

enviar para o mdb ( cadastrar.asp )...............................................................................

.........................................................................

 

<!--#include file="conexao.asp"-->
<% 
Dim conexao
Nome = Request.form("txtNome")
Descricao = Request.form("txtDescricao")
Preco = Request.form("txtPreco")
Imgs = Request.form("txtImgs")
data = day(date)&"/"&month(date)&"/"&year(date) 'aqui a data que foi efetuado o cadastro do Produto.

 
'aqui é inserido tudo na base
strInsert = " Insert into produtos "
strInsert = strInsert & "(nome, descricao, preco, imgs, data)"
strInsert = strInsert + "VALUES ('" + Nome + "',"
strInsert = strInsert + "'" + descricao + "',"
strInsert = strInsert + "'" + preco + "',"
strInsert = strInsert + "'" + imgs + "',"
strInsert = strInsert + "'" + data + "')"
'é aberta a conexao'
Call abreConexao
Set rsInsert = conexao.Execute(strInsert) 
'é fechada a conexao
Call fechaConexao
Set rsInsert = Nothing


Response.redirect("registrar.asp") 'redireciona para uma página que avise que a chave de ativação foi enviada no e-mail do destinatário. 

on error resume next
if Err.number <> 0 then
					Call Erro("Já existe um usuário cadastrado com esse nome","Err.description")
				end if

'no caso de haver um erro, pode se fazer uma página "aviso.asp" avisando do erro com um "meta refresh redirect de 8 segundos, mais ou menos", logo em seguida redirecionando para o cadastro.asp		

'If err.number <> 0 then
'Response.redirect("aviso.asp")
'end if
%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.