[RESOLVED] record refresh.. pls. help.
hi.,
this is the way i open a recordset...
VB Code:
' declarations
dim db as adodb.connection
dim adoParentRS as adodb.recordset
'on form load
set db = new adodb.connection
db.cursorlocation = aduseserver
db.open gstrConnectString
set adoparentrs = new adodb.recordset
adoparentrs.cursortype = adoopenstatic
adoparentrs.locktype = adoLockReadOnly
adoParentRS.Open "Select * from Customer", db, adoOpenStatic, adLockReadOnly
' on my command button i usually run this statement
' gsdq is a variable of double quote (")
dim sCmd as string
scmd = "Insert into Customer (CustomerCode, CustomerName) values ("
scmd = scmd & gsdq & txtfield(0).text & gsdq & ", "
scmd = scmd & gsdq & txtfield(1).text & gsq & ") "
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
Re: record refresh.. pls. help.
After your update, just close the recordset and reopen it. Your new record should be there.
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