Connecting Tech Pros Worldwide Help | Site Map

Can't seem to update all the fields in database

Newbie
 
Join Date: Apr 2006
Posts: 19
#1: Jul 26 '06
here i have attached a file see the file and i want code for that form urgent
Attached Files
File Type: zip vb6.0 login.zip (8.7 KB, 92 views)
iam_clint's Avatar
Forum Leader
 
Join Date: Jul 2006
Location: Oklahoma
Posts: 1,076
#2: Jul 26 '06

re: Can't seem to update all the fields in database


ok what is in this file i opened it no virus's found on it but no file extension what exactly is the problem and wheres the code.
Newbie
 
Join Date: Apr 2006
Posts: 19
#3: Jul 27 '06

re: Can't seem to update all the fields in database


Private Sub Command1_Click()
On Error Resume Next
If Trim(Text3.Text) = Trim(Text4.Text) Then

If (Trim(Text1.Text) = Trim(rs.Fields(0))) And (Trim(Text2.Text) = Trim(rs.Fields(1))) Then

rs!pwd = Trim(Text3.Text)
rs.Update
MsgBox "Password change successfully"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Else
GoTo level1
End If
Else
level1:
MsgBox "Please correct Password"
Text2.Text = ""
Text3.Text = ""
End If
End Sub


i am using this code changing password its ok but it is changing first field only in database when u enter 2nd o 3d field it shows error
1st field mean userids in my table ADMIN,POWER and USER are the users when i change ADMIN its ok but when i enter power or use it shows error


please see and responce to me as soon as posible if posible come to chat
koti_bujji1@yahoo.com


Thanks
sashi's Avatar
Expert
 
Join Date: Jun 2006
Location: Seremban, Malaysia
Posts: 1,630
#4: Jul 29 '06

re: Can't seem to update all the fields in database


hi kumar,

take a look at tutorial 2.. take care..

http://www.thescripts.com/forum/thread517434.html
Newbie
 
Join Date: Jul 2006
Posts: 1
#5: Jul 30 '06

re: Can't seem to update all the fields in database


Quote:

Originally Posted by iam_clint

ok what is in this file i opened it no virus's found on it but no file extension what exactly is the problem and wheres the code.

THE MAIN PROBLEM WITH THE CODE YOU ARE FETCHING ALL THE RECORDS FROM TEH DATABASE

YOU HAVE TO CHOOSE ONLY ONE.

BY USEING
RS.FILTER = "UserID = " & trim(text1.text)
if it return something.
you can update it
else
there is no user at the name
simple
Newbie
 
Join Date: Jul 2006
Posts: 26
#6: Jul 31 '06

re: Can't seem to update all the fields in database


Quote:

Originally Posted by mkfaiz

THE MAIN PROBLEM WITH THE CODE YOU ARE FETCHING ALL THE RECORDS FROM TEH DATABASE

YOU HAVE TO CHOOSE ONLY ONE.

BY USEING
RS.FILTER = "UserID = " & trim(text1.text)
if it return something.
you can update it
else
there is no user at the name
simple



why u don't try this

RecordSet.Open "Update <Table Name> Set = <Ur Field> <Where Criteria>", <Conn>, <Dynamic>, <Batch Optimistic>
Newbie
 
Join Date: Jul 2006
Posts: 1
#7: Aug 1 '06

re: Can't seem to update all the fields in database


dear friend

how do hide column in datagrid control or dbdatagrid control in vb6.0
pls help me
KUB365's Avatar
Administrator
 
Join Date: Jul 2005
Location: Portland, OR
Posts: 965
#8: Aug 1 '06

re: Can't seem to update all the fields in database


kumar_ps,

You should state your question in the first post and also when asking for help choose better titles for your thread. "Urgent Help" is not a good title.

- KUB
sashi's Avatar
Expert
 
Join Date: Jun 2006
Location: Seremban, Malaysia
Posts: 1,630
#9: Aug 7 '06

re: Can't seem to update all the fields in database


Hi Kumar,

what is so urgent my fren?? everyone is rushing for something almost every second.. so.. be relax.. pls state your problem clearly so some will be able to help out faster.. if possible post the portion of the code segment that is triggering error.. take care my fren.. :)

follow the steps below
1st - problem statement
2nd - steps taken to overcome the problem
3rd - code segment or error message/number that will be useful for troubleshooting
4th - follow-up your post for any response

it's much easier to slove problem in this way.. this is only my suggestion.. take care.. :)
Reply