Re: HELP! UPDATE syntax that work in sql server and access vba
- From: "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
- Date: Wed, 27 Aug 2008 02:24:13 -0400
When you are working with Access ODBC linked tables, you must use the JET
syntaxe. You should ask in a newsgroup about queries under Access how to
correctly translate this update query from T-SQL to JET.
Also, this newsgroup is about ADP and SQL-Server and has nothing to do with
ODBC linked tables.
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"ges" <u44973@uwe> wrote in message news:894385be4804b@xxxxxx
have upsized access to sql2005 server. Access front end. I have an open
form
for user to type in data to update the table link to sql2005 server.
I have to re-write the vba code in access form to update tables that's
link
to sql server.
In sql server (tsql) I use syntax as follow:
UPDATE table1
SET field1 = 'x',
field2 = 'y',
field3 = 'z'
FROM table2 INNER JOIN table1
ON table2.ID = table1.ID
WHERE (table2.Account ='97') AND (table2.FileType ='Sales')
I can execute the update above in sql server 2005 with no problem, the row
was updated fine. But
it give me error when I run in thru opened form vba in Access. it said
there
is syntax error (missing operator in 'z' and FROM table 2 INNER join table
1)
I also tried the following syntax in access query:
UPDATE table1
INNER JOIN table2
ON table1.ID = table2.ID
SET field1 = 'x',
field2 = 'y',
field3 = 'z'
WHERE (table2.Account ='97') AND (table2.FileType ='Sales')
It also give me the same error.
Anyone can help me with the syntax that will work in access also work in
sql
server?
Thanks in advance for any input.
Ges
--
Ges Khu
Geskhu@xxxxxxxxx
Access Beginner
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-adp-sqlserver/200808/1
.
- References:
- Prev by Date: HELP! UPDATE syntax that work in sql server and access vba
- Next by Date: Re: Opening 2003 ADP in 2007 fails even with newly defined SQL Ser
- Previous by thread: HELP! UPDATE syntax that work in sql server and access vba
- Index(es):
Relevant Pages
|