Bom dia.
Eu migrei meu sistema todo para MySQL e estou com um problema nos cadastros.
Nesse caso no Cadastro de Clientes. Ele não está gravando na base SQL o ID e nem a Data do Cadastro e Data de Nascimento.
Seguem os códigos.
cad_cliente.asp
<!--#include file="conexao.asp"--> <% connect %> <% dim sessao sessao = Request.QueryString("sessao") Session("sessao") = sessao strsql1="select * from usuario where codigo=" & Session("cod_usuario") set rs1=Conn.execute(strsql1) %> <!DOCTYPE HTML> <html lang="pt-br"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <head> <script src="mascara.js" type=text/javascript> </script> <script language="JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } function MM_displayStatusMsg(msgStr) { //v1.0 status=msgStr; document.MM_returnValue = true; } //--> </script> <script type="text/javascript"> function limparPadrao(campo) { if (campo.value == campo.defaultValue) { campo.value = ""; } } function escreverPadrao(campo) { if (campo.value == "") { campo.value = campo.defaultValue; } } </script> <!-- Início/TinyMCE --> <script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks", // Theme options theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Style formats style_formats : [ {title : 'Bold text', inline : 'b'}, {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}}, {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}}, {title : 'Example 1', inline : 'span', classes : 'example1'}, {title : 'Example 2', inline : 'span', classes : 'example2'}, {title : 'Table styles'}, {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'} ], // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <!-- Fim/TinyMCE --> </head> <title>Cadastro Cliente</title> <link href="style_site.css" rel="stylesheet" type="text/css" media="screen" /> <link rel="stylesheet" type="text/css" href="style_menu.css" /> <% Session.LCID = 1046 Session.TimeOut = 600 %> <!-- favicon --> <link rel="shortcut icon" href="favicon.png"> <!-- fim favicon --> </head> <body> <table width="972" align="center" border="0" cellpadding="2" cellspacing="2"> <tr> <td> </td> <td width="627" rowspan="2" align="right" class="style4">Day Trip || Turismo sob medida</td> </tr> <tr> <td width="301"> </td> </tr> </table> <table width="960" align="center" border="0" cellpadding="2" cellspacing="2"> <tr> <td colspan="3" align="left"> </td> </tr> <tr> <td colspan="3" align="left"><img src="images/logo_day_trip_pq.png" width="300" height="128" /></td> </tr> <tr> <td colspan="3"><table width="960" height="50" border="0" cellspacing="0" cellpadding="0"> <tr> <td background="images/tarjas/tarja_cadastro.png"><!--#INCLUDE FILE = "menu.asp" --></td> </tr> </table></td> </tr> <tr> <td colspan="3"></td> </tr> <tr> <td colspan="3"><form action="cad_cliente_resp.asp" method="post"> <table width="960" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2" class="style4"><table width="100%" border="0" cellpadding="0" cellspacing="0" id="content-box1"> <tr> <th colspan="2" align="left" bgcolor="#accabc" class="style3" scope="col"> Cadastro de Cliente</th> </tr> <tr> <th width="15%" align="right" bgcolor="#dce6e1" class="style6" scope="col"> </th> <th width="85%" align="left" bgcolor="#dce6e1" scope="col"> </th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Cliente:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="cliente" type="text" class="fct2" id="cliente" size="56" maxlength="255" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Email:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="email" type="text" class="fct2" id="email" size="56" maxlength="255" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Telefone:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="telefone" type="text" class="fct2" id="telefone" size="15" maxlength="14" onKeyUp="formataDDDTel(this,event);" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Celular:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="celular" type="text" class="fct2" id="celular" size="15" maxlength="15" onKeyUp="formataDDDCel(this,event);" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">CPF:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="cpf" type="text" class="fct2" id="cpf" size="14" maxlength="14" onKeyUp="formataCPF(this,event);" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col"> RG:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="rg" type="text" class="fct2" id="rg" size="12" maxlength="12" onKeyUp="formataRG(this,event);" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Nascimento:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="data_nascimento" type="text" class="fct2" id="data_nascimento" size="12" maxlength="10" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Cidade / UF:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="cidade" type="text" class="fct2" value="São Paulo" onfocus="limparPadrao(this);" onblur="escreverPadrao(this);" id="cidade" size="30" maxlength="255" /> <span class="style3">-</span> <select name="uf" class="fct2"uf="uf"""> <option value="AC">AC</option> <option value="AL">AL</option> <option value="AP">AP</option> <option value="AM">AM</option> <option value="BA">BA</option> <option value="CE">CE</option> <option value="DF">DF</option> <option value="ES">ES</option> <option value="GO">GO</option> <option value="MA">MA</option> <option value="MT">MT</option> <option value="MS">MS</option> <option value="MG">MG</option> <option value="PA">PA</option> <option value="PB">PB</option> <option value="PR">PR</option> <option value="PE">PE</option> <option value="PI">PI</option> <option value="RJ">RJ</option> <option value="RN">RN</option> <option value="RS">RS</option> <option value="RO">RO</option> <option value="RR">RR</option> <option value="SC">SC</option> <option value="SP" selected="selected">SP</option> <option value="SE">SE</option> <option value="TO">TO</option> </select></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Endereço:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="endereco" type="text" class="fct2" id="endereco" size="40" maxlength="255" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Complemento:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="complemento" type="text" class="fct2" id="complemento" size="13" maxlength="50" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">CEP:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="cep" type="text" class="fct2" id="cep" size="9" maxlength="9" onKeyUp="formataCEP(this,event);" /></th> </tr> <tr> <th colspan="2" align="left" bgcolor="#DCE6E1" class="style6" scope="col"> </th> </tr> <tr> <th colspan="2" align="left" bgcolor="#ACCABC" class="style3" scope="col"> Informações Adicionais<br></th> </tr> <tr> <th align="left" bgcolor="#DCE6E1" class="style6" scope="col"> </th> <th align="left" bgcolor="#DCE6E1" class="style6" scope="col"> </th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Nome Parente:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="nome_parente" type="text" class="fct2" id="nome_parente" size="56" maxlength="255" /></th> </tr> <tr> <th align="right" bgcolor="#dce6e1" class="style3" scope="col">Telefone Parente:</th> <th align="left" bgcolor="#dce6e1" scope="col"> <input name="telefone_parente" type="text" class="fct2" id="telefone_parente" size="15" maxlength="14" onKeyUp="formataDDDTel(this,event);" /></th> </tr> <tr> <th colspan="2" align="left" bgcolor="#DCE6E1" class="style6" scope="col"> </th> </tr> <tr> <th colspan="2" align="left" bgcolor="#ACCABC" class="style3" scope="col"> Observações</th> </tr> <tr> <th align="right" bgcolor="#DCE6E1" class="style6" scope="col"> </th> <th align="left" bgcolor="#DCE6E1" scope="col"> </th> </tr> <tr> <th align="right" valign="top" bgcolor="#DCE6E1" class="style3" scope="col"><br> Comentários:</th> <th align="left" valign="top" bgcolor="#DCE6E1" scope="col"> <textarea name="comentarios_cliente" cols="56" rows="3" class="fct2" value="Digite o texto..." onfocus="limparPadrao(this);" onblur="escreverPadrao(this);" id="comentarios_cliente"></textarea></th> </tr> <tr> <th align="right" valign="top" bgcolor="#DCE6E1" class="style3" scope="col"><br> Histórico:</th> <th align="left" bgcolor="#DCE6E1" scope="col"> <textarea name="historico" cols="56" rows="3" class="fct2" value="Digite o texto..." onfocus="limparPadrao(this);" onblur="escreverPadrao(this);"id="historico"></textarea></th> </tr> <tr> <th align="right" bgcolor="#DCE6E1" class="style6" scope="col"> </th> <th align="left" bgcolor="#DCE6E1" scope="col"> </th> </tr> <tr> <th colspan="2" align="right" class="style6" scope="col"> </th> </tr> <tr> <th align="right" class="style6" scope="col"> </th> <th align="left" scope="col"> <input name="submit" type="submit" class="fct2" value="Cadastrar" /> <input name="button" type="button" class="fct2" onclick="javascript:history.go(-1)" value="Voltar" /></th> </tr> <tr> <th align="right" class="style6" scope="col"> </th> <th align="left" scope="col"> </th> </tr> </table></td> </tr> </table> </form></td> </tr> <tr> <td colspan="3" align="left" class="style6">Copyright Day Trip || Turismo sob medida</td> </tr> </table> <br> </body> </html>
cad_cliente_resp.asp
<!--#include file="conexao.asp"--> <% connect %> <HTML> <HEAD> <TITLE>Cadastro Cliente</TITLE> <% Session.LCID = 1046 Session.TimeOut = 600 %> <html lang="pt-br"> <meta charset="ISO-8859-1"> </HEAD> <BODY> <% if Request.Form("data_cadastro") = 0 then data_cadastro = now() end if if Request.Form("status_cliente") = 0 then status_cliente = "A" end if cliente = Request.Form("cliente") email = Request.Form("email") telefone = Request.Form("telefone") celular = Request.Form("celular") cpf = Request.Form("cpf") rg = Request.Form("rg") data_nascimento = Request.Form("data_nascimento") cidade = Request.Form("cidade") uf = Request.Form("uf") endereco = Request.Form("endereco") complemento = Request.Form("complemento") cep = Request.Form("cep") nome_parente = Request.Form("nome_parente") telefone_parente = Request.Form("telefone_parente") comentarios_cliente = Request.Form("comentarios_cliente") historico = Request.Form("historico") strsql2=" insert into clientes(cliente,email,telefone,celular,cpf,rg,data_nascimento,cidade,uf,endereco,complemento,cep,nome_parente,telefone_parente,comentarios_cliente,historico,data_cadastro,status_cliente) values ('" & cliente & "','" & email & "','" & telefone & "','" & celular & "','" & cpf & "','" & rg & "','" & data_nascimento & "','" & cidade & "','" & uf & "','" & endereco & "','" & complemento & "','" & cep & "','" & nome_parente & "','" & telefone_parente & "','" & comentarios_cliente & "','" & historico & "','" & data_cadastro & "','" & status_cliente & "')" set rs2=Conn.execute(strsql2) %> <% response.Redirect("clientes_gerais.asp") %>