By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,778 Members | 1,318 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,778 IT Pros & Developers. It's quick & easy.

how to update the data while selecting a value from a table

chandru8
100+
P: 145
hi all iam using vb6.0

i written a query to select a value from msaccess 2003
after retrieving i check up to not rs.eof
then i check for some conditions
if the condition is ok mean ill update the value
after that i moving to the next record
but iam getting a error

code
strSql = "select * from Out where excelstatus like '%n' "
Set rs = objCon.Execute(strSql)

Do While Not rs.EOF

Select Case rs.Fields(13)
case "4"
Set rs = objCon.Execute("Update out set excelstatus = 'Y' where excelstatus = # " & Format(rs.Fields(6), "dd/mmm/yyyy") & " # "")
end select
rs.move next
loop

i need to run this for many records
thanks
Apr 23 '08 #1
Share this Question
Share on Google+
8 Replies


debasisdas
Expert 5K+
P: 8,127
You need to frame the SQL query properly.
Apr 23 '08 #2

lotus18
100+
P: 866
Expand|Select|Wrap|Line Numbers
  1. strSql = "select * from Out where excelstatus like   '%n' "
  2. Set rs = objCon.Execute(strSql)
  3.  
  4.     Do While Not rs.EOF
  5.  
  6.         Select Case rs.Fields(13)
  7.          case "4"
  8.                          Set rs = objCon.Execute("Update out set excelstatus = 'Y' where excelstatus  = # " & Format(rs.Fields(6), "dd/mmm/yyyy") & " # "")
  9. end select 
  10. rs.move next
  11. loop
  12.  
Hi

What is excelstatus' datatype? You may delete extra " at line # 8. I'd suggest if statement rather than select.

Rey Sean
Apr 23 '08 #3

chandru8
100+
P: 145
I Have Completed The Issue
Can You Give An Example To Handle The Keystrokes

Give Me Any Sample Program

Thanks
Apr 23 '08 #4

lotus18
100+
P: 866
I Have Completed The Issue
Can You Give An Example To Handle The Keystrokes

Give Me Any Sample Program
Thanks
You can handle them by using the KeyPress event.

Rey Sean
Apr 23 '08 #5

chandru8
100+
P: 145
Can You Give Me An Example Or Logic

I Need To Create A Exe That Will Run Continously When The User Ideal For 5 Min Its Need To Popup A Messge Box

Thanks
Apr 23 '08 #6

lotus18
100+
P: 866
Can You Give Me An Example Or Logic

I Need To Create A Exe That Will Run Continously When The User Ideal For 5 Min Its Need To Popup A Messge Box

Thanks
Can you explain it a little bit more?

Rey Sean
Apr 23 '08 #7

chandru8
100+
P: 145
An Exe Has To Run At The Background

If The User Is Ideal For 5 Min, Not Touched The Keyboard Mean I Need To Popup A Message
Thanks
Apr 23 '08 #8

lotus18
100+
P: 866
An Exe Has To Run At The Background

If The User Is Ideal For 5 Min, Not Touched The Keyboard Mean I Need To Popup A Message
Thanks
Be careful for the word that you are going to used. It should be idle and not ideal. Research more on keyascii code constants For example, type vbKeyA on your code then select it then right-click select Definition.
This is probably a new question and you should create another post : )

Rey Sean
Apr 23 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.