Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_ado_rds thread: problem with adding a new record into a disconnected recordset


Message #1 by "krisd" <krisd@h...> on Wed, 13 Dec 2000 12:52:40 -0000
i have followed the code in ADO RDS wrox book

creating a disconnected recordset by saving data into C:\data.dat



when i tried to create another file to add a new record into it, it din't

work



can anyone please fix this problem please?



please see code of 2 files below..

<%''THIS FILE CALLED testCreate.asp ,it works well%>

<%On Error Resume Next  

  Set objRS = Server.CreateObject("ADODB.Recordset")    

  objRS.CursorType = 3      

  objRS.CursorLocation = 3



  objRS.Open "C:\data.dat"



  If err.number = 3709 Then

    err.number = 0                                 

    objRS.Fields.Append "FName", 200, 25   

    objRS.Open

  End If



		for i = 65 to 70  

			objRS.AddNew

			objRS("FName") = CHR(i) 

			objRS.Update     

		next 



  objRS.Save "C:\data.dat"



  If err.number = 58 Then	

    objRS.Save 

  End If



  objRS.Close

  Set objRS = Nothing 

%>



========================================

<%''THIS FILE CALLED testAdd.asp   IT DOESNT WORK.....              

  Set objRS = Server.CreateObject("ADODB.Recordset")     

  objRS.CursorLocation = 3

 

  objRS.Open "C:\data.dat"  

  objRS.addnew

		objRS("Fname")="G" 

  objRS.Update  

	   

  objRS.Close 

  Set objRS = Nothing 

%>



---

You are currently subscribed to asp_ado_rds as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_ado_rds-$subst('Recip.MemberIDChar')@p2p.wrox.com


  Return to Index