Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 16th, 2005, 05:47 AM
Authorized User
 
Join Date: Apr 2004
Location: Gurgaon, Haryana, India.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ranakdinesh
Default UPDATE CURRENT RECORD

I HAVE A TABLE ITEM WITH ITEM_NO,ITEM_NAME,ITEM_STATUS_NO
I HAVE TO UPDATE ITEM_STATUS_NO BY SELECTING ONE BY ONE IN A LOOP WHAT THE PROBLEM IS IT GIVES ME ERROR CANNOT UPDATE CURRENT RECORD BECAUSE OF CONNECTION TYPE OR lOCKTYPE. INTIALLY SAME CODE WAS REUNNIG ON ms acceSS BUT IT IS NOT RUNNIG ON sQL SERVER
THE cONNETION TYPE IS
CNN IN A SONNECTION STRING USED TO CONNECT THE DATABASE mS sQL
DIM STRSQL
DIM CNN
DIM RST
SET CNN = SERVER.cREATEOBJECT("ADODB.cONNECTION")
SET RST = sERVER.CREATEOBJECT("ADODB.rECORDSET")
SET CNN = SERVER.CREATEOBJECT("aDODB.cONNECTION")
STRSQL = "SELECT * FROM ITEM"
RST.OPEN STRSQL,CNN, ADOPENKEYSET,ADLOCKOPTIMISTIC

DO WHILE NOT RST.EOF
RST("ITEM_STAUS_NO") = NYMBER23
RST.UPDATE
LOOP

WHAT IS WRONG I DONT KNOW

dinesh Rana
__________________
dinesh Rana
Reply With Quote
  #2 (permalink)  
Old March 16th, 2005, 12:38 PM
Friend of Wrox
 
Join Date: Jan 2004
Location: , , USA.
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code you have posted I do not see that you have established connection to your db

Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("Your Connection String")

If you are using SQL Server then something like this

Conn.Open("Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;")






Reply With Quote
  #3 (permalink)  
Old March 17th, 2005, 12:58 AM
Authorized User
 
Join Date: Apr 2004
Location: Gurgaon, Haryana, India.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ranakdinesh
Default

Sorry i forgoten to write it in the code here yes i have made connection
application("cnstring")= "Provider=sqloledb;" & _
           "Data Source=hopeone;" & _
           "Initial Catalog=diert;" & _
           "Integrated Security=SSPI;"
and the same is given in the Global.asa and is used to call it like

cnn.open application("cnstring")
know the complete code is

DIM STRSQL
DIM CNN
DIM RST
SET CNN = SERVER.cREATEOBJECT("ADODB.cONNECTION")

SET RST = sERVER.CREATEOBJECT("ADODB.rECORDSET")
SET CNN = SERVER.CREATEOBJECT("aDODB.cONNECTION")
cnn.open application("cnstring")
STRSQL = "SELECT * FROM ITEM"
RST.OPEN STRSQL,CNN, ADOPENKEYSET,ADLOCKOPTIMISTIC

DO WHILE NOT RST.EOF
RST("ITEM_STAUS_NO") = NYMBER23
RST.UPDATE
LOOP

WHAT IS WRONG I DONT KNOW



dinesh Rana
Reply With Quote
  #4 (permalink)  
Old March 17th, 2005, 04:03 AM
Authorized User
 
Join Date: Aug 2003
Location: Jakarta, DKI Jakarta, Indonesia.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sherief Send a message via Yahoo to sherief
Default

try this:

rst.open strsql, cnn, adopenstatic, adlockpessimistic

Regards,
Sherief C. Mursyidi
Reply With Quote
  #5 (permalink)  
Old March 17th, 2005, 05:32 AM
Authorized User
 
Join Date: Apr 2004
Location: Gurgaon, Haryana, India.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ranakdinesh
Default

no
rst.open strsql, cnn, adopenstatic, adlockpessimistic
this does not works as the arguments are conflicting with each other

dinesh Rana
Reply With Quote
  #6 (permalink)  
Old March 17th, 2005, 12:16 PM
Friend of Wrox
 
Join Date: Jan 2004
Location: , , USA.
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you including adovbs.inc in your code?

Response.Write your SQL statement

RST.OPEN STRSQL,CNN, ADOPENKEYSET,ADLOCKOPTIMISTIC
Response.Write(strSQL)

and post the exact error message you are receiving in this forum

Reply With Quote
  #7 (permalink)  
Old March 18th, 2005, 02:22 AM
Authorized User
 
Join Date: Apr 2004
Location: Gurgaon, Haryana, India.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ranakdinesh
Default

the exact error is
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.

yes i included adovbs.inc



dinesh Rana
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
print current record on another form jcellens Access 7 February 14th, 2006 02:01 PM
Current Record Number Base VB How-To 1 December 7th, 2005 05:26 PM
print current record in a form mjuliao Access 1 November 15th, 2005 08:57 AM
Error 3021 - No Current Record JackNimble BOOK: Expert One-on-One Access Application Development 5 October 2nd, 2004 03:26 PM
Print current record vladimir Access 2 September 10th, 2003 11:53 PM



All times are GMT -4. The time now is 09:06 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.