Home > SQL Development > UPDATE method of Recordset to modify dbase, Win 2000

UPDATE method of Recordset to modify dbase, Win 2000



<i><b>Originally posted by : Jeanie Stewart (health@delanet.com)</b></i><br />Hi,<br />I've been using this ASP code for over a year (Win 98, IE 5.00.2314.1000) with no trouble. But lately I've been downloading my database to my laptop (Windows 2000, IE 5.00.3103.1000) and running it there too. <br />Most of the code works fine, it's just when I try to update the database using the "UPDATE method of the Recordset Object to Modify Database Records" (this is what Sam's Teach Yourself ASP book calls it, day 12), it bombs out on the Recordset.Fields.Item assignment statement with the ERROR "wrong number of arguments or invalid property assignment".<br />The same code and data work on one computer, and don't work on the other. Is there something different about the handling with Windows 2000, or does that have nothing to do with it?<br />I know there are other ways to update the database such as the SQL Update method - I use these too - but I'd rather avoid changing over the code everywhere if I could.<br />Thanks in advance,<br />Jeanie<br /><br />sample code section<br />----------------------------------------<br />Set DBConnection = Server.CreateObject("ADODB.Connection")<br />DBConnection.Open "FILEDSN=ZoneDSN.dsn"<br />Set TempRecordset = Server.CreateObject ("ADODB.Recordset")<br />TempRecordset.CursorType=1<br />TempRecordset.CursorLocation=2<br />TempRecordset.LockType=3<br />TempRecordset.ActiveConnection=DBConnection<br />TempRecordset.Source="Members"<br />TempRecordset.Filter="Club=" & Request.Form("MemberNumber")<br />TempRecordset.Open<br />TempRecordset.Fields.Item("Lastattend") = Date<br />TempRecordset.Fields.Item("Usecount") = _<br /> TempRecordset.Fields.Item("Usecount") + 1<br />TempRecordset.Update<br />TempRecordset.Close<br /><br />

    
Guest


First: it's less typing to use:



TempRecordset("Usecount")



instead of



TempRecordset.Fields.Item("Usecount")



Second, MDAC has seen new versions (currently 2.8). I would say that your application uses version 2.1. I remember problems of that kind when passing to Win2k, Access2k and other which use/install ADO. Try upgrading to at least 2.6 to see if this solves the issue.



Martin

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved