Cannot add a new record to database

Results 1 to 2 of 2

Thread: Cannot add a new record to database

  1. #1
    Join Date
    Dec 1969

    Default Cannot add a new record to database

    Dear all<BR>My code is:<BR>..... <BR>..... <BR>Dim oRS1 <BR>Set oRS1=Server.CreateObject("ADODB.Recordset") <BR><BR>set oConn=Server.CreateObject("ADODB.connection") <BR>oConn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("/FingerTipOld.mdb") <BR><BR>oRS1.Open "Staffinfo", oConn,adopenKeyset,adLockOptimistic <BR><BR>oRS1.AddNew <BR>oRs1.Fields("strStaffID")=Request.Form("txtSta ffID") <BR>oRs1.Fields("strFingerTip")=Request.Form("txtF ingerTipID") <BR>oRs1.Fields("strDepartment")=Request.Form("txt Department") <BR>oRs1.Fields("curSalary")=Request.Form("txtSala ry") <BR>oRs1.Fields("curSalaryOT")=Request.Form("txtSa laryOT") <BR>oRs1.Fields("curHourlySalary")=Request.Form("t xtHourlySalary") <BR>oRs1.Fields("strPosition")=Request.Form("txtPo sition") <BR>oRs1.Fields("strEmailAddress")=Request.Form("t xtEmailAddress") <BR>oRs1.Fields("dtmEmploymentday")=Request.Form(" txtEmploymentDate") <BR>oRs1.Fields("dtmResignationday")=Request.Form( "txtResignationDate") <BR>oRs1.Fields("dtmstaffcome")=Request.Form("txtW orkTime") <BR>oRs1.Fields("dtmstaffleave")=Request.Form("txt LeaveTime") <BR>&#039;oRs1.Fields("ysnchangeAuthorization")=Re quest.Form("Cchange") <BR>&#039;oRs1.Fields("ysnsearchAuthorization")=Re quest.Form("Csearch") <BR>oRs1.Fields("ysnchangeAuthorization")=Request. Form("R1") <BR>oRs1.Fields("ysnsearchAuthorization")=Request. Form("R2") <BR>oRs1.Fields("strpassword")=Request.Form("txtpa ssword") <BR><BR>oRs1.Update <BR>... <BR>... <BR><BR>I can extract the information from the request.form("txtstaffid"), but the program got error when it running to oRs1.Update.So I can not register a new user to the database. The error is <BR><BR>Microsoft OLE DB Provider for ODBC Drivers ¿ù»~ &#039;80004005&#039; <BR><BR>[Microsoft][ODBC Microsoft Access ÅX°Êµ{¦¡] µLªk§ó·s¡C¸ê®Æ®w©Îª«¥ó¬O°ßŪ ªº¡C <BR><BR>/registrationconfirm.asp, ¦C27 <BR><BR><BR>/************************************<BR><BR>I have check that The syntax and the code is right,and I have use the Jet provider method, but I still can not add a new record to the database, Is the server has problem ?<BR>Regards <BR>eric <BR>

  2. #2
    Join Date
    Dec 1969


    I&#039;ve seen this in two forums so far...<BR><BR>the error message isn&#039;t at all helpful, and I don&#039;t have my reference guide with me, so i&#039;m not sure how the error code maps to a text description. possibly the database itself (or the folder it&#039;s in) is read only (?) or possibly a type mismatch in one of the columns? check all the column types and Cast the variables explicitly to that type...?<BR><BR>j

Posting Permissions

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