Conexao banco postgres ASP<br /><%<br /> 	Set objConn = Server.CreateObject("ADODB.Connection")<br />functionabreConexao()...
Include para conexao<br /><!--#include file="conexao.asp"--><br />
Formulario de entrada(Montando Combobox)<br /><tr><br />	<td><br />    	Status<br />    </td><br /> 	<td><br />        <se...
Java script alert + redireciona<br />%><br />        <script language="JavaScript" TYPE="text/javascript"><br />alert("Con...
Recuperando dados na combobox<br /><selectname="status" id="status"><br /><%<br />sql_status= "Select * fromtb_status"<br ...
SQL INSERT ASP<br />sql_insert="INSERT INTO pessoa (nome,endereco) VALUES('"&nome&"','"&endereco&"‘)<br />objConn.Execute(...
SQL UPDATE ASP<br />sql_update="UPDATE  pessoa SET nome='"&nome&"',endereco='"&endereco&"', whereidpessoa="&idpesoa<br />o...
Prochain SlideShare
Chargement dans…5
×

Aspdevice - Asp Fast Crud introdution

736 vues

Publié le

Introdução ao Crud para usuarios avançados, pontos de duvidas.

Publié dans : Technologie
0 commentaire
0 j’aime
Statistiques
Remarques
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Aucun téléchargement
Vues
Nombre de vues
736
Sur SlideShare
0
Issues des intégrations
0
Intégrations
1
Actions
Partages
0
Téléchargements
3
Commentaires
0
J’aime
0
Intégrations 0
Aucune incorporation

Aucune remarque pour cette diapositive

Aspdevice - Asp Fast Crud introdution

  1. 1. Conexao banco postgres ASP<br /><%<br /> Set objConn = Server.CreateObject("ADODB.Connection")<br />functionabreConexao()<br />objConn.ConnectionString = "Driver={PostgreSQL ANSI};Server=localhost;Port=5432;Database=teste;Uid=postgres;Pwd=sql;"<br />objConn.Open<br />endfunction<br />functionfechaConnexao()<br />objConn.Close()<br />endfunction<br />%><br />
  2. 2. Include para conexao<br /><!--#include file="conexao.asp"--><br />
  3. 3. Formulario de entrada(Montando Combobox)<br /><tr><br /> <td><br /> Status<br /> </td><br /> <td><br /> <selectname="status" id="status"><br /> <%<br />abreConn()<br />sql_status = "Select * fromstatus"<br /> Set resultado = objConn.Execute(sql_status)<br />whilenot resultado.eof<br />response.Write("<optionvalue='"& resultado("idstatus") &"'>"& resultado("status”)&"</option>")<br /> resultado.movenext<br />wend<br />fechaConn()<br /> %><br /> </select><br /> </td><br /> </tr><br /><tr><br /> <tdcolspan="2" align="center"><br /> <input type="submit" name="salvar" id="salvar" value="Salvar" /><br /> <input type="button" value="Voltar" onClick="document.location.href='index.asp'"/><br /> </td><br /></tr><br /></form><br />
  4. 4. Java script alert + redireciona<br />%><br /> <script language="JavaScript" TYPE="text/javascript"><br />alert("Contato inserido com sucesso!");<br />location.href="INDEX.ASP";<br /> </script><br /> <%<br />
  5. 5. Recuperando dados na combobox<br /><selectname="status" id="status"><br /><%<br />sql_status= "Select * fromtb_status"<br />Set rs2 = objConn.Execute(sql_status)<br />whilenot rs2.eof<br />ifrs2("idstatusfunc")<>idstatusthen<br />response.Write("<optionvalue='"& rs2("idstatusfunc") &"'>"&rs2("statusfunc")&"</option>")<br />else<br />response.Write("<optionselectedvalue='"& rs2("idstatusfunc") &"'>"& rs2("statusfunc")&"</option>")<br />endif<br />rs2.movenext<br />wend<br />%><br /></select><br />
  6. 6. SQL INSERT ASP<br />sql_insert="INSERT INTO pessoa (nome,endereco) VALUES('"&nome&"','"&endereco&"‘)<br />objConn.Execute(sql_insert)<br />
  7. 7. SQL UPDATE ASP<br />sql_update="UPDATE pessoa SET nome='"&nome&"',endereco='"&endereco&"', whereidpessoa="&idpesoa<br />objConn.Execute(sql_update)<br />

×