Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Returning @@Identity from an Insert to Access Database
Old 12-20-2005, 04:41 AM Returning @@Identity from an Insert to Access Database
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
Hi there.
I wish to return the identity of an insert to an access database.

my sql is as below :

nameSQL = "insert into personal (title, first_name, surname, address, post_code, home_phone, mobile, fax, email_address) VALUES ('"&strTitle&"','"&strFirstName&"','"&strSurname&" ','"&strAddress&"','"&strPostcode&"','"&strHomepho ne&"','"&strMobile&"','"&strFax&"','"&streMail&"') ;" &_
"SELECT @@IDENTITY AS NewID;"

However this is as I would use with mySQL. When I use on my access database, I get an internal server error. If I take out the SELECT, the script does work so I know that my problem isn't related to my SQL syntax of the INSERT.

Any input would be appreciated.
Steve
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 12-20-2005, 10:08 PM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
What exactly is the error you're getting?

(Tip: If this is a test server, make sure IIS is configured to send detailed error messages to the client, and make sure 'Enable Friendly HTTP Error messages' is turned off in IE. Then you'll see detailed errors instead of just the usual 'Internal Server Error')
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Reply     « Reply to Returning @@Identity from an Insert to Access Database
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.54606 seconds with 12 queries