avatar
A*s
1
Table: eW
Field: InW(Integer) EnC(Integer)
Table: eC
Field: InC(Integer) NameC(String)
Dim i As Integer
Dim strTemp As String
想要把InW=i的那个eW表中的记录更新,使得其EnC这个field取值为eC表
中对应NameC=strTemp的那个InC,该怎么写sql语句呢?
谢谢
avatar
p*m
2
try:
UPDATE eW
SET ENC = (SELECT EnC from eC WHERE NameC = strTemp)
not sure about it.

【在 A***s 的大作中提到】
: Table: eW
: Field: InW(Integer) EnC(Integer)
: Table: eC
: Field: InC(Integer) NameC(String)
: Dim i As Integer
: Dim strTemp As String
: 想要把InW=i的那个eW表中的记录更新,使得其EnC这个field取值为eC表
: 中对应NameC=strTemp的那个InC,该怎么写sql语句呢?
: 谢谢

avatar
A*s
3
//bow

【在 p****m 的大作中提到】
: try:
: UPDATE eW
: SET ENC = (SELECT EnC from eC WHERE NameC = strTemp)
: not sure about it.

avatar
A*s
4
我写作:
UPDATE eW SET EnC = ( select InC from eC where DescC = 'strTemp') FROM eW,
eC WHERE InW = i
vb执行的时候出错了,说:
Run-time error '-2147217900 (80040e14)':
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression '( select InC from eC where DescC = 'strTemp') FROM eW
这是为什么呢?

【在 p****m 的大作中提到】
: try:
: UPDATE eW
: SET ENC = (SELECT EnC from eC WHERE NameC = strTemp)
: not sure about it.

avatar
b*e
5
remove "from eW, eC"

【在 A***s 的大作中提到】
: 我写作:
: UPDATE eW SET EnC = ( select InC from eC where DescC = 'strTemp') FROM eW,
: eC WHERE InW = i
: vb执行的时候出错了,说:
: Run-time error '-2147217900 (80040e14)':
: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
: query expression '( select InC from eC where DescC = 'strTemp') FROM eW
: 这是为什么呢?

avatar
A*s
6
UPDATE eW SET EnC = ( select InC from eC where DescC = 'strTemp') WHERE InW
= i
Run-time error '-2147467259 (80040005)':
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable q
uery

【在 b****e 的大作中提到】
: remove "from eW, eC"
avatar
A*s
7
UPDATE eW SET EnC = ( select InC from eC where DescC = 'strTemp') WHERE InW
= i
Run-time error '-2147467259 (80040005)':
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable q
uery

【在 b****e 的大作中提到】
: remove "from eW, eC"
avatar
b*e
8
do you have more than 1 row in eC where descC = 'strTemp'?

【在 A***s 的大作中提到】
: UPDATE eW SET EnC = ( select InC from eC where DescC = 'strTemp') WHERE InW
: = i
: Run-time error '-2147467259 (80040005)':
: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable q
: uery

avatar
A*s
9

InW
q
no...

【在 b****e 的大作中提到】
: do you have more than 1 row in eC where descC = 'strTemp'?
avatar
a*a
10
I doubt if Access supports nested query. try using MSDE?

【在 A***s 的大作中提到】
: UPDATE eW SET EnC = ( select InC from eC where DescC = 'strTemp') WHERE InW
: = i
: Run-time error '-2147467259 (80040005)':
: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable q
: uery

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。