asp e access 2007

<%
var CS= "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\meusiteasp\exemplos\pl5.accdb";
var myConnection = Server.CreateObject("ADODB.Connection");
%>
Criei objecto...
<%
myConnection.open(CS); //nao chega aqui...
%>
abrir connect



Ao executar no IIS ele imprime "Criei objecto", mas nao imprime "abrir connect"
onde está mal?
 
<%
var CS= "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\meusiteasp\exemplos\pl5.accdb";
var myConnection = Server.CreateObject("ADODB.Connection");
%>
Criei objecto...
<%
myConnection.open(CS); //nao chega aqui...
%>
abrir connect



Ao executar no IIS ele imprime "Criei objecto", mas nao imprime "abrir connect"
onde está mal?

isso é "pseudo-código" ou tens mesmo isso a correr ? é que isso não é asp ... pelo menos sintaticamente :joker:

vê se este link te ajuda
 
isso é um bocado de codigo de asp com javascript.
mas eu meto o exemplo todo...


pl5.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pl5</title>
</head>

<body>


<form name="input" action="pl5.asp" method="post">
Username&nbsp; <input type="text" name="user"><br>
Email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="email">
<input type="submit" value="Registar">
</form>
<!--
<form>
<p>Como tomou conhecimento?</p>
<input type="radio" > Net
<br>
<input type="radio" > Amigo
<br>
<input type="radio" > Jornal
<br>
<input type="radio" > TV

</form>
-->
</body>

</html>
pl5.asp
<%@ Language=JScript %>

<html>

<head>

<title>pl5</title>
</head>

<body>
<%
var nome=Request.QueryString("user");
var email=Request.QueryString("email");

var CS= "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\meusiteasp\exemplos\pl5.accdb";
%>
<%
var myConnection = Server.CreateObject("ADODB.Connection");
%>
Criei objecto...
<%
myConnection.open(CS);
%>
abrir connect
<%
myRecordSet = myConnection.Execute("INSERT INTO visitante(Nome, Email) VALUES('" & nome & "','" & email & "')");
%>
inserir


<% myRecordSet.Close();
myConnection.Close();
%>
</body>

</html>

A ideia é pois inserir numa base de dados de access 2007 (já criada) dados que sao inseridos no form.
 
Back
Topo