Why can't I add/update my record?

Results 1 to 2 of 2

Thread: Why can't I add/update my record?

  1. #1
    Join Date
    Dec 1969

    Default Why can't I add/update my record?

    Okay I am now frustrated. I have written ADO code before that updates and add new records to a SQL table, now I am trying to do it with Access and it is blowing up on my rs.update command.<BR>I have used response.write to test and it is reading from the table fine. I have tried adOpenStatic,AdOpenKeyset and adLockPessimistic,adLockOptimistic and no success.<BR><BR>Does anyone know what I am doing wrong? I have read my old code, the ASPFAQs and MSDN and I can&#039;t figure it out...Help!!!!<BR><BR>Jose<BR><BR>below is my code...<BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;!-- #INCLUDE FILE="adovbs.inc" --&#062;<BR><BR><BR>&#060;%<BR> Add_to_Database()<BR><BR> public sub Add_to_Database()<BR> <BR> dim rs <BR> dim strConnection<BR> dim qryReunion<BR> <BR> set rs = server.CreateObject("ADODB.Recordset")<BR> <BR> qryReunion = "Select FirstName, LastName, Street, City, State, ZipCode, Email from MAIL"<BR> strConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("adelacas
    eunion.mdb")<BR> <BR> rs.CursorLocation = AdUseClient <BR> rs.Open qryReunion, strConnection, adOpenStatic, adLockPessimistic<BR> <BR> rs.AddNew<BR> rs.Fields("FirstName") = "Testjjj"<BR> <BR> rs.Update<BR> rs.Close<BR> set rs = nothing<BR><BR> Response.Write rs("FirstName")<BR> end sub<BR><BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Why can't I add/update my record?

    try to replace the cursor location make it server side

Posting Permissions

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