954,228 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem in updating datas in database without exiting application.

I use
dim mydb as recordset
and also use
mydb.update
in certain required places like the update command button clicking. It works, by adding the new value in database. I have a list that shows the values of that db. But the main problem is i cannot see the newly added values unless i exit and reopen the application. after reopen i can see the newly added value. But i want to see the value in run time after clicking the add button which add value from a text box that i write. Sorry for the long literature, please help me.

shahriar2403
Light Poster
29 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

try list1.refresh after the updating part,

but sometimes this does not work.
Best way,after updating,close the connection then open it again,ok?

ryan_vietnow
Posting Pro
578 posts since Aug 2007
Reputation Points: 28
Solved Threads: 71
 

Try mydb.requery as well

SCBWV
Junior Poster
125 posts since Apr 2007
Reputation Points: 40
Solved Threads: 24
 

As i am not so expert, would u please tell me what should be the code example of closing connection?

shahriar2403
Light Poster
29 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

mydb.close

ryan_vietnow
Posting Pro
578 posts since Aug 2007
Reputation Points: 28
Solved Threads: 71
 

What is the type of connection that you are using.

debasisdas
Posting Genius
6,870 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

if u r using the DAO technique use the table recordset type at the time of opening the recordset. a sample is :-

dim db as database,rs as recordset

set db=opendatabase(app.path & "\mydb.mdb")
set rs=db.openrecordset("table1",dbopentable)
if rs.recordcount>0 then
''ur data showing code goes here
endif

otherwise u have to simultaneously unload and show up ur forms.

choudhuryshouvi
Posting Pro
553 posts since May 2007
Reputation Points: 30
Solved Threads: 49
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You