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!!!
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
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
Re: Please Help Vb6 program dealing with Time
Quote:
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
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
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
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.
Re: Please Help Vb6 program dealing with Time
Quote:
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 ;)
Re: Please Help Vb6 program dealing with Time
Also, a more important thing...
DO NOT use ADO Data Control