dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Process stops

  1. #1
    Join Date
    Jun 2002
    Location
    Bangalore
    Posts
    42

    Question Process stops

    Hi Gurus,

    I am facing a serious problem. Can you help me please.

    I have a small program written in VB 6.0. This will be capturing the serial output from the computer using mscomm control and does some manupulation and save the data in the Access DB. The programme will be running 24 hrs a day and exe size only 108KB.

    After 2 or 3 days it stops the process. Means data will not be capturing. For 8 to 10 hrs it works fine. What could be the problem...?

    Is it because of memory problem...? How to refresh the memory...?

    I am using 5 recordset object variables in this procedure but closing every time after usage. And setting it to 'Nothing'.

    If you have any idea please reply to me as soon as possible.

    Thank you

    Benny
    Benny C A
    Al Ain, UAE

  2. #2
    Join Date
    Sep 2001
    Location
    Québec, Canada
    Posts
    1,923
    Hum, try trapping each errors and create you a small log where you write all anormal comportment. I have already done a program that run 24h/24 and there was no problem like that. It is sure that there is an error occuring some time, it might be anything, but I don't think this is a memory problem if you're using Winnt.

    JeffB - hope it helps

  3. #3
    Join Date
    Jun 2002
    Location
    Bangalore
    Posts
    42
    Hi JeffB,

    I got your reply, thanks for the same.

    My programm is running on win98 and it is a serial communicatio programme. Means it will collect the strings coming to the serial port and some times it will send the strings to the serial port.

    After a long time this communication process stops but the programme responding means not hanging.

    Did you done any programme based on serial communiation. Is this problem is because of the port?

    Thank you

    Bye
    Benny C A
    Al Ain, UAE

  4. #4
    Join Date
    Jun 2002
    Location
    Lyman ME - USA | Oneonta NY - USA
    Posts
    399
    I haven't done any serial port comm. programming but i have written a media player that runs for however long i want it to. I have built in alarms and timers to turn it off if i want to listen for say 20 minutes or so i put in 20 mins then it will turn off after 20 mins...But i have had it running for like 5 days without any problems....I would say to do as jeff said and create an error catching log file. It could be a memory issue but i would find that hard to believe. What kind of database are you using, i know that some databases(not sure about all) have to be compressed in order to work correctly. Have you checked for issues that could happen with null values for instance or anything else? It would be good to start from the begining of your program and go through all the ways an error could occur...then just create a log file for all of those errors once they occur...if nothing is written to the log file when your program stops(it doesn't need to hang for an error to occur) it will write the error to the log if it is an error. If you check and see no errors then you may want to check the memory usage and build in a function to write the percentage of memory being used to a log or something like that...Use logs they are your friend especially in areas like these.

    Hope it helps, and good advice JeffB

    - nc
    "In a world without walls and barriers, what need is there for windows and gates!" - a mac ad
    "What was the best thing before sliced bread and when did sliced bread go out of existence?" - me
    "Software is like sex, it's better when it's free." - Linus Torvalds <- gotten from Andreas Masur


    Live Penguine! - Tux the linux mascot
    Vivez le penguine!, ¡Viva en penguine!, Lang lebe der Pinguin!, Viva no penguine!, Viva sul penguine!

  5. #5
    Join Date
    Sep 2001
    Location
    Québec, Canada
    Posts
    1,923
    Hum, port communication programming and Database can generate errors, and you must be worry about it. A database transaction, as a COM transaction, can fail for different raisons, it might your application that have an error or the system that cause an error.

    I suggest the log file thing, it is pretty simple, you'll have to trap the error on each sub and function, for each of them, use On error goto ErrorNameOfSub. You'll have to create a variable that will contains the name of the Sub, and, if any, the name of the module, and you'll create a WriteLog function that will accept SubName, ModuleName, Err object, with that, your function will write a line in a log file that would looks like "09/08/02 - 09:28:40 MODULE1 - SUB1 - ERROR NUMBER - ERROR DESCRIPTION".

    Well, that is just a suggestion, but it is quite easy to do, and will ensure that your application will not crash. Also, if you have specific object that contains error (like the ADODB.Connection object), try to add the error description in the log, same things if you use APIs, use GetLastError() APIs.

    Well, if you don't fell a log, can try to debug.print or to msgbox or to debug any other way, it is your choice

    JeffB - hope it helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)