473,748 Members | 9,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Type mismatch error with SELECT...FOR UPDATE statement

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.CreateOb ject("ADODB.Con nection")
objConn.Open strConnectionSt ring
Set objRs = Server.CreateOb ject("ADODB.Rec ordSet")
objRs.CursorLoc ation = adUseClient
objRs.open "SELECT * FROM EMP UPDATE OF EMPNO", objConn,
adOpenForwardOn ly, adLockBatchOpti mistic
//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!!

May 24 '06 #1
19 8378
Where are you getting this syntax from - 'update of', 'select for update'?

Bob Lehmann

"Steve" <ja*****@gmail. com> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
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.CreateOb ject("ADODB.Con nection")
objConn.Open strConnectionSt ring
Set objRs = Server.CreateOb ject("ADODB.Rec ordSet")
objRs.CursorLoc ation = adUseClient
objRs.open "SELECT * FROM EMP UPDATE OF EMPNO", objConn,
adOpenForwardOn ly, adLockBatchOpti mistic
//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!!

May 24 '06 #2
I presume you are using mssql and not msAccess ?

May 24 '06 #3
Steve wrote:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement


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"
May 24 '06 #4
I am using oracle 9i database. I tried to execute the query in Oracle
and it works fine, then it should work fine if the ASP page executes
that query runs on Oracle?
Bob Barrows [MVP] wrote:
Steve wrote:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement


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"


May 24 '06 #5
I don't know. I have no experience with Oracle.
What is the purpose of that syntax in Oracle? I.E., what is the goal you
are trying to accomplish that can't be accomplished with standard ANSI
SQL?

Bob Barrows
Steve wrote:
I am using oracle 9i database. I tried to execute the query in Oracle
and it works fine, then it should work fine if the ASP page executes
that query runs on Oracle?
Bob Barrows [MVP] wrote:
Steve wrote:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE
statement


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?


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
May 24 '06 #6
I am wondering the same thing.....

It sounds to me like you may be wanting to carry out a secure
transaction... in which case, ASP has the tools to do it.

You'll need to use the proper transaction properties of the database
objects....
E.g....
.....

<%
Set con = Server.CreateOb ject("ADODB.Con nection")

con.Open connectionStrin g 'open connection
con.BeginTrans 'Begin the transaction

con.Execute("in sert into YourTablename values ('testFieldData ')")
'insert a record

if YourTestConditi on = True then
con.CommitTrans
else
con.RollBackTra ns
end if

Set Con = Nothing
%>

Hope this helps,

Rob
http://www.webforumz.com/asp-forum/ - ASP Forum

May 24 '06 #7
I tried to put con.BeginTrans and it seems working. Is that all I
need??

objConn.BeginTr ans
objRS.Open "SELECT * FROM EMP UPDATE OF EMPNO", objConn,
adOpenForwardOn ly, adLockBatchOpti mistic
con.CommitTrans
SEOSpecialist wrote:
I am wondering the same thing.....

It sounds to me like you may be wanting to carry out a secure
transaction... in which case, ASP has the tools to do it.

You'll need to use the proper transaction properties of the database
objects....
E.g....
....

<%
Set con = Server.CreateOb ject("ADODB.Con nection")

con.Open connectionStrin g 'open connection
con.BeginTrans 'Begin the transaction

con.Execute("in sert into YourTablename values ('testFieldData ')")
'insert a record

if YourTestConditi on = True then
con.CommitTrans
else
con.RollBackTra ns
end if

Set Con = Nothing
%>

Hope this helps,

Rob
http://www.webforumz.com/asp-forum/ - ASP Forum


May 24 '06 #8
Yes, you need to tell SQL you are beginning a transaction.

May 24 '06 #9
The interesting thing is that why we need to call objConn.BeginTr ans if
we use UPDATE OF clause? For other regular SQL statement, we don't need
to call objConn.BeginTr ans at all, and I never use this method before.
Is this ASP specific problem?

please advise. thanks again!!

May 24 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6228
by: Robert Mark Bram | last post by:
Hi All! I have the following two methods in an asp/jscript page - my problem is that without the update statement there is no error, but with the update statement I get the following error: Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Syntax error in UPDATE statement. /polyprint/dataEntry.asp, line 158
4
11967
by: Mike | last post by:
I am getting a type mismatch error when I do a bulk insert. ---Begin Error Msg--- Server: Msg 4864, Level 16, State 1, Line 1 Bulk insert data conversion error (type mismatch) for row 1, column 14 (STDCOST). ---End Error Msg--- The STDCOST is set to decimal (28,14) and is a formatted in Access as a number, single with 14 decimal. I don't know why I would be getting a Type
0
2253
by: news.paradise.net.nz | last post by:
I have been developing access databases for over 5 years. I have a large database and I have struck this problem with it before but can find nothing in help or online. Access 2000 I have a query that will run fine without any criteria but as soon as I add any criteria it gives a "Data type mismatch" error. As soon as I remove any criteria it runs perfectly. I know this query is based on another query but I have other processes based on...
5
4379
by: TD | last post by:
I created a query in Access 2000 that runs perfectly. I then copied the "sql" version of the same query and set it equal the variable "sql" in the code below. When I run the code below I get an "Type Mismatch" error. Can someone explain how to fix this? Thanks, TD Private Sub cmdSave_Click()
8
6023
by: aland | last post by:
Hi, I'm hoping someone can help me with this code. I'm getting a 'Type mismatch' error, and I'm not sure why. The SQL works fine in SQL view, so I'm not sure if that's the problem or not. This is a dumbed down version of what I'm trying to do so it looks like more like an academic problem. All I want at this stage is to get the highest value of table.id into a variable. Dim strSQL As String Dim RS As Recordset
1
3091
by: amitbadgi | last post by:
HI i am getting the foll error while conv an asp application to asp.net Exception Details: System.Runtime.InteropServices.COMException: Syntax error in UPDATE statement. Source Error: Line 112: MM_editCmd.ActiveConnection = MM_editConnection Line 113: MM_editCmd.CommandText = MM_editQuery Line 114: MM_editCmd.Execute
1
2044
by: jodyblau | last post by:
I am getting a type mismatch message under strange circumstances. Here's whats going on: 1. I have split the database into a front end and a back end. 2. I have compiled the project. 3. I update the linked tables and then make an mde file. 4. When I use the mdb file, everything seems to work fine.
5
2846
by: kjworm | last post by:
Hello Everyone, I have been fighting with a type mismatch error for many hours today and I can't seem to find what the problem is. Hopefully it is more than a missing apostrophe! I have isolated each SQL statement using a MsgBox and then input that exact code as a Query in access which works. I'm using Access 97 on Windows XP. My code is below: Dim strKaizen As String strKaizen = "UPDATE KaizenEvents SET(TeamLeader)= '" & & "' WHERE...
3
5471
by: JaketheSnake27 | last post by:
I am completely stumped on what seems to be a completely simple thing. What I'm trying to do is use a SELECT CASE with a recordset. The SELECT CASE looks at one field from the recordset to establish the CASE's. I looked at the table that this field comes from and the field's data type is "text." When I make my CASE's, the program runs fine if I just put numbers for the requirements. I.E. Case "734" The problem I am having is that as...
0
8989
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8828
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.