Good morning people
I would like to help a little bit boring, maybe even something banal
I have a page in asp connect.asp as follows
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%
<%
dim conn
sub AbreConn()
'Criamos o objeto de conexão
Set conn = Server.CreateObject("ADODB.Connection")
'Abrimos uma conexão com o banco de dados
conn.Open("DRIVER={MySQL ODBC 5.1 Driver};SERVER=server;PORT=3306;DATABASE=database;USER=usuario;PASSWORD=senha;OPTION=3;")
conexao_executa=true
end sub
sub fechaConn()
'Fechamos a conexão com o banco de dados
conn.Close()
'Destruímos o objeto
Set conn = Nothing
end sub
'sub que executara comandos no bd
sub executaconexao(comando)
if conexao_executa=false then
call AbreConn
end if
response.Write(comando)
set objComando = Server.CreateObject("ADODB.Command")
objComando.ActiveConnection = conn
objComando.CommandText = comando
objComando.Execute()
Set objComando = Nothing
call fechaConn
end sub
%>
I can not run the select's
, but it does not usually have any errors. However, at the time of doing an update or insert it does not execute anything,
If anyone has any suggestions on what can be done thank you.
Below is how I call the update on page envia.asp
sql ="update produtos set descricao_produto = '" & server.HTMLEncode(request.form("elm1")) & "' where codigo_chave = 32"
executaconexao(sql)