Problems inserting on an Access Database

Results 1 to 2 of 2

Thread: Problems inserting on an Access Database

  1. #1
    Join Date
    Dec 1969

    Default Problems inserting on an Access Database

    Hey, guys. I hope someone can help me and that this ain&#039;t a stupid question.<BR><BR>Anyway, I&#039;m struggling with the most stupid task: Insert a new registry on an Access database. It always sends me the following error message:<BR><BR>Error Type:<BR>Microsoft OLE DB Provider for ODBC Drivers (0x80004005)<BR>[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.<BR>/add.asp, line 29<BR><BR>The code is:<BR><BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;% Option Explicit %&#062;<BR><BR>&#060;!--#include virtual="/"--&#062;<BR><BR>&#060;%<BR>Dim conntemp, objRS, strTexto, iTemp, strTopico, strAutor, dateData, iTipo, cnpath, arrTexto<BR><BR>strTexto = request ("mensagem")<BR>iTipo = request ("tipo")<BR>iTemp = request ("temporada")<BR>strTopico = request ("topico")<BR>strAutor = request ("autor")<BR><BR>arrTexto = Replace (strTexto, Chr(10), "<BR>", 1)<BR><BR>set conntemp=server.createobject("adodb.connection")<B R>cnpath="DBQ=" & server.mappath("realitycenter2.mdb")<BR>conntemp.O pen "DRIVER={Microsoft Access Driver (*.mdb)};" & cnpath<BR><BR>Set objRS = Server.CreateObject("ADODB.Recordset")<BR>objRS.op en "Principal", conntemp, , 3, 2<BR>objRS.AddNew<BR>objRS("Tipo") = iTipo<BR>objRS("RealityShow") = iTemp<BR>objRS("Topico") = strTopico<BR>objRS("Autor") = strAutor<BR>objRS("CorpoMensagem") = arrTexto<BR>objRS.Update<BR>objRS.close<BR>Set objRS = Nothing<BR>conntemp.close<BR>Set conntemp = Nothing<BR><BR>%&#062;<BR><BR>It&#039;s a very simple code, created to react to a form. The arrTexto receives a huge string, texts with over 20ks. It&#039;s treated to be readable in ASP. I hope you guys can see what I&#039;m doing wrong here. The database is ok, all fields are in the text format, except for the CorpoMensagem one, which is in the memo format (as it should be).<BR><BR>Thanks in advance for the help.

  2. #2
    Join Date
    Dec 1969


Posting Permissions

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