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

Insert string value in a field with where condition.

P: 23
I have some value in my main table:All_Table
A columh(Net_Login) with value:"xyz"
I have a string:strValue

I want to insert/update(which will work fine?)my table"All_table",strvalue where xyz found.

What i tried and saya error msg'Semicolon (;) missing '
Code is:
Expand|Select|Wrap|Line Numbers
  1. strUpdateTbl = "INSERT INTO All_Table
  2. (Net_Login) VALUES (" & strvalue & ") " & _
  3.                     " WHERE ([All_Table].[Net_login])='xyz'"
  4.         cnnProject.Execute (strUpdateTbl)
Please rectify my error.
Apr 12 '12 #1
Share this Question
Share on Google+
1 Reply

P: 62
The SQL clause "insert into" is for an append query. Use the "update" clause instead. Why don't you create a simple update query in the query design view first, and then switch to SQL view to see how the "update" clause is written?
Apr 13 '12 #2

Post your reply

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