944,183 Members | Top Members by Rank

Ad:
Nov 6th, 2007
0

Problem in updating datas in database without exiting application.

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
shahriar2403 is offline Offline
29 posts
since Jun 2007
Nov 6th, 2007
0

Re: Problem in updating datas in database without exiting application.

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?
Reputation Points: 28
Solved Threads: 71
Posting Pro
ryan_vietnow is offline Offline
578 posts
since Aug 2007
Nov 6th, 2007
0

Re: Problem in updating datas in database without exiting application.

Try mydb.requery as well
Reputation Points: 40
Solved Threads: 24
Junior Poster
SCBWV is offline Offline
125 posts
since Apr 2007
Nov 6th, 2007
0

Re: Problem in updating datas in database without exiting application.

As i am not so expert, would u please tell me what should be the code example of closing connection?
Reputation Points: 10
Solved Threads: 0
Light Poster
shahriar2403 is offline Offline
29 posts
since Jun 2007
Nov 7th, 2007
0

Re: Problem in updating datas in database without exiting application.

mydb.close
Reputation Points: 28
Solved Threads: 71
Posting Pro
ryan_vietnow is offline Offline
578 posts
since Aug 2007
Nov 7th, 2007
0

Re: Problem in updating datas in database without exiting application.

What is the type of connection that you are using.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Nov 7th, 2007
0

Re: Problem in updating datas in database without exiting application.

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.
Reputation Points: 30
Solved Threads: 49
Posting Pro
choudhuryshouvi is offline Offline
553 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: noob here! combo box
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: visual basic six Data storage calculator





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC