Results 1 to 3 of 3

Thread: [RESOLVED] record refresh.. pls. help.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    208

    Resolved [RESOLVED] record refresh.. pls. help.

    hi.,

    this is the way i open a recordset...
    VB Code:
    1. ' declarations
    2.  
    3. dim db as adodb.connection
    4. dim adoParentRS as adodb.recordset
    5.  
    6. 'on form load
    7.  
    8. set db = new adodb.connection
    9. db.cursorlocation = aduseserver
    10. db.open gstrConnectString
    11.  
    12. set adoparentrs = new adodb.recordset
    13. adoparentrs.cursortype = adoopenstatic
    14. adoparentrs.locktype = adoLockReadOnly
    15.  
    16. adoParentRS.Open "Select * from Customer", db, adoOpenStatic, adLockReadOnly
    17.  
    18. ' on my command button i usually run this statement
    19. ' gsdq is a variable of double quote (")
    20.  
    21. dim sCmd as string
    22.  
    23. scmd = "Insert into Customer (CustomerCode, CustomerName) values ("
    24. scmd = scmd & gsdq & txtfield(0).text & gsdq & ", "
    25. scmd = scmd & gsdq & txtfield(1).text & gsq & ") "
    26. db.execute scmd
    my problem is if insert a new record to the CUSTOMER Table, it took a while before the recordset was updated even i run the adoParentRS.requery ... so, i created a function to delay the code for about 2 seconds then i'll run the .requery and it's only the time that the recordset will be updated.




    thanks in advance for your help.


    alexis
    Last edited by alexis23; Feb 27th, 2006 at 07:45 PM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: record refresh.. pls. help.

    After your update, just close the recordset and reopen it. Your new record should be there.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    208

    Re: record refresh.. pls. help.

    hi there,

    i tried closing the recordset then reopen it, but nothing has changed.. i still cant see the newly added record right away... i cant run the .update coz im opening the recordset at readonly because im working with bookmarks.

    alexis

Posting Permissions

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



Click Here to Expand Forum to Full Width