![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
|
: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 |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
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 |
|
|
|
|
|
#3 |
|
Newbie
|
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 |
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
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 |
|
|
|
|
|
#5 |
|
Newbie
|
thanks a lots Berto....
some one that have the better VB solutions for me ??? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|