使用SELECT ... FOR UPDATE语句的ASP类型不匹配错误 [英] ASP Type mismatch error with SELECT...FOR UPDATE statement

查看:72
本文介绍了使用SELECT ... FOR UPDATE语句的ASP类型不匹配错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASP错误号13 - 类型不匹配SELECT ... FOR UPDATE语句


当我使用SELECT ... FOR UPDATE语句时,我得到了ASP错误号13 >
如下。

但是,如果我使用没有FOR UPDATE的SELECT语句,那很好,

没有错误。

我也试过设置objRs = objConn.Execute(SELECT * FROM EMP UPDATE OF

EMPNO),但它仍然没有帮助。


任何想法?我试图在网上搜索但是找不到类似的

问题。是因为

设置问题?

这里是代码片段:

=========== =============

On Error Resume Next

设置objConn = Server.CreateObject(" ADODB.Connection")

objConn.Open strConnectionString

设置objRs = Server.CreateObject(" ADODB.RecordSet")

objRs.CursorLocation = adUseClient

objRs.open" SELECT * FROM EMP UPDATE OF EMPNO",objConn,

adOpenForwardOnly,adLockBatchOptimistic

//等等......

ErrHndl:

response.write Err.Source& "< br>"

response.write"错误号码" &安培;错误号码& "< br>"

response.write"错误说明" &安培;错误的描述& " br>"

response.end

错误:

============= ==========

Microsoft VBScript运行时错误

错误号13

错误描述类型不匹配

请指教。非常感谢!!

ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement

I got ASP error number 13 when I use the SELECT...FOR UPDATE statement
as below.
However, if I use SELECT statement without FOR UPDATE, it is fine and
no error.
I also tried Set objRs = objConn.Execute("SELECT * FROM EMP UPDATE OF
EMPNO"), but it still couldn''t help.

any ideas? I tried to search in the web but couldn''t find similar
problem. Is it because
the setting problems?
Here''s the code fragment:
========================
On Error Resume Next
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnectionString
Set objRs = Server.CreateObject("ADODB.RecordSet")
objRs.CursorLocation = adUseClient
objRs.open "SELECT * FROM EMP UPDATE OF EMPNO", objConn,
adOpenForwardOnly, adLockBatchOptimistic
//etc...
ErrHndl:
response.write Err.Source & "<br>"
response.write "Error number " & err.number & "<br>"
response.write "Error description " & err.description & "<br>"
response.end
Errors:
=======================
Microsoft VBScript runtime error
Error number 13
Error description Type mismatch
Please advise. thanks a lot!!

推荐答案

你从哪里获得这种语法 - '''更新'',''选择更新''?


Bob Lehmann


" Steve" < JA ***** @ gmail.com>在消息中写道

新闻:11 ********************** @ i39g2000cwa.googlegr oups.com ...
Where are you getting this syntax from - ''update of'', ''select for update''?

Bob Lehmann

"Steve" <ja*****@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
ASP错误号13 - 类型不匹配SELECT ... FOR UPDATE语句

当我使用SELECT ... FOR UPDATE语句时,我得到了ASP错误号13,如下所示。
但是,如果我使用没有FOR UPDATE的SELECT语句,那很好,没有错误。
我也尝试过设置objRs = objConn.Execute(" SELECT * FROM EMP UPDATE OF < EMPNO),但它仍然无济于事。

任何想法?我试图在网上搜索但是找不到类似的问题。是因为
设置问题吗?

这里是代码片段:
=================== =====
On Error Resume Next
设置objConn = Server.CreateObject(" ADODB.Connection")
objConn.Open strConnectionString
设置objRs = Server.CreateObject( " ADODB.RecordSet")
objRs.CursorLocation = adUseClient
objRs.open" SELECT * FROM EMP UPDATE OF EMPNO",objConn,
adOpenForwardOnly,adLockBatchOptimistic
//等......
ErrHndl:
response.write Err.Source& "< br>"
response.write"错误号码" &安培;错误号码& "< br>"
response.write"错误说明" &安培;错误的描述& "< br>"
response.end

错误:
===================== ==
Microsoft VBScript运行时错误
错误号13
错误描述类型不匹配

请指教。非常感谢!!
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement

I got ASP error number 13 when I use the SELECT...FOR UPDATE statement
as below.
However, if I use SELECT statement without FOR UPDATE, it is fine and
no error.
I also tried Set objRs = objConn.Execute("SELECT * FROM EMP UPDATE OF
EMPNO"), but it still couldn''t help.

any ideas? I tried to search in the web but couldn''t find similar
problem. Is it because
the setting problems?
Here''s the code fragment:
========================
On Error Resume Next
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnectionString
Set objRs = Server.CreateObject("ADODB.RecordSet")
objRs.CursorLocation = adUseClient
objRs.open "SELECT * FROM EMP UPDATE OF EMPNO", objConn,
adOpenForwardOnly, adLockBatchOptimistic
//etc...
ErrHndl:
response.write Err.Source & "<br>"
response.write "Error number " & err.number & "<br>"
response.write "Error description " & err.description & "<br>"
response.end
Errors:
=======================
Microsoft VBScript runtime error
Error number 13
Error description Type mismatch
Please advise. thanks a lot!!



我认为你使用的是mssql而不是msAccess?

I presume you are using mssql and not msAccess ?


Steve写道:
ASP错误号13 - 类型不匹配SELECT ... FOR UPDATE语句
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement




永远不要问数据库 - 相关问题没有透露什么数据库类型

和你正在使用的版本。


我从未见过FOR UPDATE除了在SQL Server中使用。在SQL Server中,只有在声明T-SQL游标时才能使用
。所以,即使在SQL Server中,如果你在其他任何地方使用它,你将会遇到语法错误。


我不能代表其他数据库,比如Oracle。


为什么你希望(或者认为你需要)使用这种语法?


Bob Barrows

-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。这个电子邮件帐户是我的垃圾邮件陷阱所以我

不经常检查它。如果您必须离线回复,请删除

无垃圾邮件



Never ask a database-related question without revealing what database type
and version you are using.

I have never seen "FOR UPDATE" used except in SQL Server. In SQL Server, it
can only be used when declaring a T-SQL cursor. So, even in SQL Server, if
you use it anywhere else, you will get a syntax error.

I cannot speak for other databases like Oracle.

Why do you wish to (or think you need to) use this syntax?

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don''t check it very often. If you must reply off-line, then remove the
"NO SPAM"


这篇关于使用SELECT ... FOR UPDATE语句的ASP类型不匹配错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆