ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 19th, 2012, 12:08 PM
jmss66 jmss66 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 2 jmss66 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 45 sec
Reputation Power: 0
ASP 1.0 - Update arecord using Prepared Statement

I am trying to include Prepare Statement in my program and so far I have learned how to do a select statement with parameter. Next I am trying to update a record but keep getting the error messge below:







Microsoft JET Database Engineerror '80004005'

Operation must use an updateable query. /development/CheckLogin.asp, line 102



Here is my code where I am updating using Prepared Statement. I don't even know if how I am using prepared statement is correct.



Code:





   Set objCmd = Server.CreateObject("ADODB.command")

   set rsUsers = Server.CreateObject("ADODB.Recordset")

   objCmd.ActiveConnection = objConn

   objCmd.Prepared = True

   objCmd.CommandType = adCmdText

   objCmd.CommandText = "UPDATE Member SET LastLogin = ?"

   objCmd.Parameters.Append(objCmd.CreateParameter("@LastLogin", adDate, adParamInput, Len(Now()), Now()))

    rsUsers.CursorType = adOpenKeyset

    rsUsers.LockType = adLockOptimistic

    objCmd.Execute()






Below is my code for the Select Statement which is doing fine. This one executes before the code above which I am having a problem with..



Code:

Dim rsUsers

Set objCmd = Server.CreateObject("ADODB.command")

set rsUsers = Server.CreateObject("ADODB.Recordset")

objCmd.ActiveConnection = objConn

objCmd.Prepared = True

objCmd.CommandType = adCmdText

objCmd.CommandText = "SELECT * FROM Member WHERE SSN = ?"

objCmd.Parameters.Append(objCmd.CreateParameter("@SSN", adChar, adParamInput, Len(strSSN), strSSN))

rsUsers.CursorType = adOpenKeyset

rsUsers.LockType = adLockOptimistic

rsUsers.Open = objCmd.Execute()




Please I am new to using Prepared Statement and asking for any assistance.

Thanks.

Reply With Quote
  #2  
Old April 20th, 2012, 09:55 AM
jmss66 jmss66 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 2 jmss66 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 45 sec
Reputation Power: 0
Any help please will be appreciated. Just take a stab at it please.

Reply With Quote
  #3  
Old July 27th, 2012, 12:13 PM
shanevic7 shanevic7 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 1 shanevic7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 10 sec
Reputation Power: 0
sorry bro i wish i could help, i really tried but no luck. hope someone could help

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > ASP 1.0 - Update arecord using Prepared Statement


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap