DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 11 of 11

Thread: Pls how can i design a program to calculate time

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Posts
    12

    Pls how can i design a program to calculate time

    A vb 6.0 program to calculate the time an application takes to open and save the time in a database.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    By open do you mean execute?

    Are you simply looking to see how long it takes to display the main screen after its icon is double clicked on?

  3. #3
    Join Date
    Aug 2010
    Posts
    12
    i meant execute, for it to show on the screen.

  4. #4
    Join Date
    Dec 2009
    Posts
    13
    1. declare two public String variables as InTime and OutTime

    2. your application may contains more than one forms. so in the form_load event of the 1st form type InTime = Time

    3. If u have typed "End" command in your application type OutTime = Time before the end command.

    Note: - Most probably we use MDIForm as the main form. if you are using an MDIForm, u can type InTime = Time in MDIForm load event and OutTime = Time in MDIForm unload event.

    I think u r trying to maintain a in - out log file. if so u need to update the database after passing parameter to the variables.

    SORRY FOR MY BAD ENGLISH. I TRIED MY LEVEL BEST TO EXPLAIN. IF U HAVE ANY DOUBTS PLEASE REPLY.

  5. #5
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    I don't see the need for MDI for something like this, and the Form_Load of any standard form would do just as nicely.

  6. #6
    Join Date
    Aug 2010
    Posts
    12

    A program that sends information in a network from a database

    Please I want to get an idea on how to write a program that will send a request to a particular system after a request form must have been filled by the client. The program can also check if the item being requested is available in the database. Thanks

  7. #7
    Join Date
    Dec 2009
    Posts
    13

    Smile

    I think i can help u. but your statement is not very clear to me. please give some more information and then i think i can upload a sample program to u. enjoy with devX.

  8. #8
    Join Date
    Oct 2010
    Posts
    22

    Database

    Look over this and see if you understand it.
    VB6 and with ref. to DAO 3.6

    Code:
    Dim db As Database
    Dim xRec As Recordset
    Dim strSQL as String
    
    On Error GoTo ErrorLine '<--This is needed
    
    Set db = DBEngine.Workspaces(0).OpenDatabase(App.Path & "\Data.mde", False, False) 'Open Database
    strSQL = "SELECT ID, Field1, Field2, Field3, filePath FROM Table1 WHERE Field1 = -1" 'Setup SQL 
    
    Set xRec = db.OpenRecordset(strSQL, dbOpenDynaset) 'Execute SQL
    
    xRec.MoveFirst 'Find out if we have records, if not we error
    
    xRec.Close
    Exit Sub
    
    ErrorLine:
    Debug.Print Err.Number
    Debug.Print Err.Description
    
    If Err.Number = 3021 Then
    Err.Clear
    Msgbox "Nothing Here"
    End If
    
    xRec.Close
    Err.Clear
    
    End Sub
    Hope this points you in the right direction

  9. #9
    Join Date
    Aug 2010
    Posts
    12
    Quote Originally Posted by everzcool4 View Post
    I think i can help u. but your statement is not very clear to me. please give some more information and then i think i can upload a sample program to u. enjoy with devX.


    Okay, i would like to get a program that has a database of items in it, someone can request for item on the network and the request goes to another system for approval. If the item is not available in the database, the system will indicate.

  10. #10
    Join Date
    Oct 2010
    Posts
    22

    Not sure

    I'm not sure how my database reply got here. But, it is here so I'll try and stick to thread.

    You call the Time() function before anything your trying to time.

    Example:
    Dim z as Variant, y as Variant
    z = Time
    ...Go do something...
    y = Time

    y = y - z


    Hope it helps,
    Sorry didn't mean to post this thread.

  11. #11
    Join Date
    Oct 2010
    Posts
    22

    Just in case

    The example i gave doesn't have/need to be placed on the stack. Could be a memory location.

    i.e.
    Dim <- could be a global

    Sorry for the bad ex.

Similar Threads

  1. Prime number program to make go faster
    By divagoddess in forum C++
    Replies: 12
    Last Post: 05-07-2006, 10:55 PM
  2. Replies: 5
    Last Post: 03-25-2006, 07:58 AM
  3. C++ program to calculate exponent
    By berrysnick in forum C++
    Replies: 3
    Last Post: 03-30-2005, 12:07 AM
  4. VB6: ADODC design time vs run time database
    By Tim Johnson in forum VB Classic
    Replies: 4
    Last Post: 09-12-2002, 09:27 AM
  5. Replies: 0
    Last Post: 11-10-2000, 07:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center