Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
Guest - Simone -

Conexão Ao Banco

Question

Guest - Simone -

Olá .

Tem pouco tempo que começei aprender ASP e estou fazendo um pequeno teste com banco de dados em access. Gostaria que alguém me ajudasse pois ´não está funcionando

<%@LANGUAGE="VBSCRIPT"%>

<html>

<head>

<title>respostas</title>

</head>

<body>

<%

Dim cod,nome,senha,InstrucaoSql,Constr

cod = Replace (Request.Form ("codigo"), "'", "''")

nome = Replace (Request.Form ("nome"), "'", "''")

senha = Replace (Request.Form ("senha"), "'", "''")

email = Replace (Request.Form ("email"), "'", "''")

Set conexao=Server.CreateObject("ADODB.Connection")

constr=Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\simone\banco.mdb;

conexao.Open(constr);

InstrucaoSql= "insert into Aluno(Cod, Nome, senha, email)values ('" Cod & "','" & Nome & "','" & senha & "','" & email & "')"

conexao.Execute(InstrucaoSql)

conexao.Close

Set conexao = Nothing

Response.write "<center><h4> Obrigada! Cadastro concluído com sucesso</h4></center>"

%>

<a href="mostrar.asp" target="direita2">Confira</a><br>

</body>

</html>

Obs: o erro é esse:

Tipo de erro:

Erro de compilação do Microsoft VBScript (0x800A0401)

Fim da instrução esperado

/resp.asp, line 21, column 35

constr=Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\simone\banco.mdb;

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Simone, tenta mudar esta linha que deu erro para:

constr= "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\simone\banco.mdb"

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  



  • Forum Statistics

    • Total Topics
      148105
    • Total Posts
      643381
×
×
  • Create New...