Help...Adding new record to a recordset

Results 1 to 3 of 3

Thread: Help...Adding new record to a recordset

  1. #1
    Join Date
    Dec 1969

    Default Help...Adding new record to a recordset

    I&#039m trying to insert a new record into a table by manipulating the recordset on an asp page. The table temptable never updates, it has no records, only field names. I have the recordset open as adOpenDynamic, adLockOptimistic, adCmdText.<BR><BR>Can anybody help??<BR><BR>Set temprs = newado.GetAdoRecordset("DSN=dnsaccess", "Select * From temptable")<BR>temprs.AddNew<BR>temprs("Local_RTP" ) = resultvalue<BR>temprs.Update<BR>&#039the new record is not added and the grid only display the <BR>&#039field names<BR>Gridocx1.SetExternalRecordset temprs<BR>

  2. #2
    J. Paul Schmidt Guest

    Default Use adLockOptimistic

    You can use adLockReadOnly lock type (the default) whenever possible for speed, but use adLockOptimistic when updating and deleting.<BR><BR>Here&#039s some reference (the Const values are from<BR>Const adOpenForwardOnly = 0<BR>Const adLockOptimistic = 3<BR><BR>Set MyRSObject = Server.CreateObject("ADODB.Recordset")<BR>MyRSObje ct.Open MySQLStringVariable, MyConnObject, adOpenForwardOnly, adLockOptimistic<BR><BR>Best regards,<BR>-Paul<BR><BR>J. Paul Schmidt, MBA<BR>Databases on the Web<BR><BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Use adLockOptimistic

    The weird thing is i can update a table opening another recordset the same way(MyRSObject.Open MySQLStringVariable, MyConnObject, adOpenForwardOnly, adLockOptimistic). the grid shows the updated records on the asp page when i update a table.. but i can not add a new record to an empty table, the recordset is still empty when i tried to display it!<BR><BR>any other suggestions??<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