Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 22nd, 2004, 2:01 AM   #1
jeremylim2000
Newbie
 
Join Date: Sep 2004
Posts: 6
Rep Power: 0 jeremylim2000 is on a distinguished road
Send a message via MSN to jeremylim2000
:unsure:

Hi! I implement a program (.exe) using VB running non-stop. The memory usage will keep on increase until full or hang there.

When timer on it will update tables, records,
and execute sql statement.

The timer is set to default.

pls someone help me urgent
jeremylim2000 is offline   Reply With Quote
Old Sep 22nd, 2004, 2:19 AM   #2
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
how can we help if we cant see the problem?
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Old Sep 22nd, 2004, 3:10 AM   #3
jeremylim2000
Newbie
 
Join Date: Sep 2004
Posts: 6
Rep Power: 0 jeremylim2000 is on a distinguished road
Send a message via MSN to jeremylim2000
In that system it will loop by use of timer.
every second it will do some checking ...
to open sql, update tables and so ons...
as I want 2 know got any apllcation messages,
or other api commands that will realease the memory usage, cpu usage
of this program .


as some of the sample code below...

Private Sub Timer1_Timer()

ProcessBackEnd
end sub



in ProcessBackend procedure, I will do


Public Sub ProcessBackEnd(ByVal fmMe As Form, ByVal i As Integer)
Select Case i
Case 1: DoGeneration
Case 2: DoSales frmMe
End Select
End Sub

Public Function DoGeneration()

sSQL = "Select * from stock "
Set rsGeneration = ado.Execute(sSQL)

While Not rsgeneration.EOF

sSQL = "select count(*) from price

rs_price.Open sSQL, ado, adOpenDynamic, adLockOptimistic

If rs_price.EOF Or rs_price!ct < 5 Then
Gendono rsGeneration!Pcode, "", rsGeneration!RPrice
End If

rsGeneration.MoveNext
Wend

Public Sub DoSales(ByVal fmMe As Form)
Dim sSQL As String
Dim rs As ADODB.Recordset

sSQL = "SELECT * FROM tbl_sales '
Set rs = ado.Execute(sSQL)
If Not rs.EOF Then
While Not rs.EOF
PostSales rs!TransNo
doStructure rs!TransNo
rs.MoveNext
Wend
End If
rs.Close

End Sub
jeremylim2000 is offline   Reply With Quote
Old Sep 22nd, 2004, 4:03 AM   #4
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
i dont no much about vb but are you closing the connection or using the same one, because if you keep opening new conenctions without lcosing the old ones it will make it stall.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Old Sep 22nd, 2004, 4:35 AM   #5
jeremylim2000
Newbie
 
Join Date: Sep 2004
Posts: 6
Rep Power: 0 jeremylim2000 is on a distinguished road
Send a message via MSN to jeremylim2000
thanks a lots Berto....

some one that have the better VB solutions for me ???
jeremylim2000 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:48 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC