473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

SELECT SCOPE_IDENTITY() problems

Hi,

I'm having trouble getting this ASP code to work. I want to retrieve the record just added, and found the scope_identity() syntax, but I get the following error:

Microsoft JET Database Engine error '80040e14'

Characters found after end of SQL statement.

Original code:

Query = "INSERT INTO tbl_requests([id], [from], [days], [requested], [manager]) VALUES ('" & Session("id") & "','" & request("date_from") & "','" & request("date_days") & "','" & date() & "','" & request("manager") & "'); SELECT SCOPE_IDENTITY();"

kbRS.Open Query, strConn, adOpenStatic, adLockOptimistic

Thanks in advance for anyone's help!

T
Aug 7 '07 #1
0 1202

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

Similar topics

3
by: Christopher Brandsdal | last post by:
Hi! I am having some problems width a little script i downloaded... I'm not able to figure out what he SELECT line does! What does the @@identity mean? Is this maby a javascript? :)
5
by: Rick | last post by:
I want to write a single sp where I pass in the column values and if it finds an exact match it returns the refid of that match else if it doesn't find it, it adds a new row using the passed in...
5
by: Larry | last post by:
I am seeing a problem with an ASP application, where I have 2 tables. In the first table, the ASP inserts just 1 row and retrieves the primary key of the new row using SCOPE_IDENTITY. It then uses...
0
by: avinashraj | last post by:
Hi All, I need to run a compound SQL statement involving a insert into followed by a select into statement from a ADO.NET command object. The insert into inserts the record while the select into...
2
by: Banski | last post by:
Hi, Im trying to use SELECT @@IDENTITY in a transaction. But it always returns 0. Im using an ms access database. And using the following code. What am i doing wrong? Best regards banski ...
1
by: Justyn | last post by:
Hi everyone, I hope someone can help me out! I have added a trigger that gets fired on INSERT and which itself inserts data into another table WITHOUT an identity I used to get back the...
13
by: PinkBishop | last post by:
I am using VS 2005 with a formview control trying to insert a record to my access db. The data is submitted to the main table no problem, but I need to carry the catID to the bridge table...
2
by: tslorick | last post by:
Hi, I'm having trouble getting this ASP code to work. I want to retrieve the record just added, and found the scope_identity() syntax, but I get the following error: Microsoft JET Database...
3
by: Miro | last post by:
I am trying to get my ID added from a people table in an access table "MyContacts.mdb" i just added. Its basically a contact file i created in access: PK Person_ID - Unique - autoincrement...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
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,...
0
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...
0
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...

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.