-
November 5th, 2013, 07:29 PM
#1
Please Help Vb6 program dealing with Time
Hi can you help me
i have vb6 program and ms access database.
I encode data to my program and save to database.
i want to know for example i change the data to my database how did my program automatically change the value of the save one.
SCENARIO :
(encoded to program)
Name : Randy
Position : Janitor
Process : Cleaning Cr
Time of Process : 0.5 hrs
i have a database for all the process and time. what i want is when i edit the time of process the save record for randy will automatically change the time of process also.
PLEASE HELP!!!
-
November 5th, 2013, 07:31 PM
#2
Re: Please Help Vb6 program dealing with Time
for example when i edit the database of Process and Time
Process : Cleaning Cr Time of Process : 1 hr (change from 0.5)
i want all saved data with process : cleaning cr will automatically change all its value to 1hr
-
November 5th, 2013, 08:35 PM
#3
Re: Please Help Vb6 program dealing with Time
Study ADO and SQL
You need to learn about how to open and close recordsets,
how to read, modify and delete records, etc.
But if you post the code where you have problems then somebody else could help you
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
November 5th, 2013, 09:22 PM
#4
Re: Please Help Vb6 program dealing with Time
Originally Posted by jggtz
Study ADO and SQL
You need to learn about how to open and close recordsets,
how to read, modify and delete records, etc.
But if you post the code where you have problems then somebody else could help you
Please see what is the problem here. my program always hang when i click this command button. im trying to make a button that will automatically update all records on my adodc3. after changing value in my adodc2
Code:
Do until Adodc3.Recordset.EOF
'combo 3
Adodc2.RecordSource = "select * from addcodes where codez = '" & Text142.Text & "'"
Adodc2.Refresh
Text171.Text = Adodc2.Recordset("codez")
Text172.Text = Adodc2.Recordset("timez")
Text31.Text = Val(Text172.Text) * Val(Text25.Text)
Text10.Text = Text172.Text
Adodc3.Recordset("strtl1") = Text31.Text
Adodc3.Recordset.MoveNext
Loop
strconfirm = MsgBox("Update finished!", vbExclamation + vbOKOnly, "Skykitchen")
Adodc3.Recordset.Update
Adodc3.Refresh
Adodc3.Refresh
Last edited by GremlinSA; November 6th, 2013 at 02:22 AM.
Reason: added code tags
-
November 5th, 2013, 10:11 PM
#5
Re: Please Help Vb6 program dealing with Time
[CODE]
Do until Adodc3.Recordset.EOF
Loop
[/
CODE]
This will loop forever. Create and instance of Adoc3 (and delete when done)
Samples have been posted many times. search is your friend
-
November 5th, 2013, 10:13 PM
#6
Re: Please Help Vb6 program dealing with Time
Try moving the
Adodc3.Recordset.Update
just before
Adodc3.Recordset.MoveNext
The Update will be in a record by record basis
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
November 6th, 2013, 03:30 AM
#7
Re: Please Help Vb6 program dealing with Time
A bit besides the topic. masternz06 You should also start naming your controls properly. A name such as Text171 and Text172 is very ridiculous. How on earth can you remember what Textbox 39, or Textbox 73 does. Give them proper names. Also, the more controls you have on your form, the more troublesome your form will react.
-
November 6th, 2013, 08:29 PM
#8
Re: Please Help Vb6 program dealing with Time
Originally Posted by HanneSThEGreaT
A bit besides the topic. masternz06 You should also start naming your controls properly. A name such as Text171 and Text172 is very ridiculous. How on earth can you remember what Textbox 39, or Textbox 73 does. Give them proper names. Also, the more controls you have on your form, the more troublesome your form will react.
Agreed those names would get out of hand quick, I can't even imagine 172 text boxes on a form.
Of course I am guilty of not using descriptive names in many of my projects just for ease of coding and execution speed.
For example if I had a recordset that was returning 30 fields that I needed to display I would likely take the easy way out and write something like
Code:
For x=0 to rs.fields.count-1
Text1(x).Text=Rs.Fields(x)
Next
and of course for clearing them
Code:
For x=0 to 29
Text1(x).text=""
Next
But I am lazy
Always use [code][/code] tags when posting code.
-
November 6th, 2013, 08:38 PM
#9
Re: Please Help Vb6 program dealing with Time
Also, a more important thing...
DO NOT use ADO Data Control
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|