Problem with insert into database

Results 1 to 2 of 2

Thread: Problem with insert into database

  1. #1
    Join Date
    Dec 1969

    Default Problem with insert into database

    Hi,<BR>I am trying to insert into my database but I keep getting errors, does someone know what is wrong with this piece of code. My connection works fine, the form data is also ok. the problem is on the execute string<BR><BR>This is the error that I am getting:<BR>There was an error processing your request. Please contact an administrator from the contact page.<BR><BR>I am working via ftp to a server, the DSN connection is working fine because I already displayed info from the database, The problem is inserting on it. Do I have to modify permisions?<BR><BR>Have a good day<BR>JC<BR>&#060;%<BR>dim sSQL<BR>dim MyConn<BR>dim uno<BR><BR>Set MyConn= Server.CreateObject("ADODB.Connection")<BR>MyConn. Open= "survey"<BR><BR>uno = request.form("participoprepcom") <BR>sSQL = "INSERT INTO Encuesta (participoprepcom)"<BR>sSQL = sSQL & " VALUES (&#039;" & uno & "&#039;)" <BR>MyConn.Execute sSQL<BR>Response.Write "&#060;B&#062;Inserted:&#060;/B&#062;<BR>" <BR><BR>Myconn.Close<BR>Set Myconn = nothing<BR>Set sSQL = nothing<BR><BR>%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default Probably permissions.

    Do what the message says. Contact the admin.<BR><BR>If this is an ".mdb" database, then both the directory and the .mdb file itself must give WRITE permission to the IUSR_xxx account.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts