Updating a database with vb6

i am trying to edit a record that i just saved into the databasebut the code I have been using has been giving me some errors " run time error '3251': current recordset does not support updating. You can overcome this by using an array to keep track of changes not yet posted to your local recordset and only do a requery when the array gets to a certain size. If you're really trying to help them, you have a responsibility to see that you're not giving them wrong information. I apologise for the "mistake" but object to the term "howlers".This maybe a limitation of the provider,or of the selected locktype " I am using the code below for my update: Set rs = New ADODB. Open "Access", Con, ad Open Forward Only, , ad Cmd Table If Not txt User Number. Also, the Filter method works better for me in this context than the Find method. Especially when you contradict someone else who is trying to help too. This post has been edited by Bob Rodes: 07 April 2013 - AM Private Sub Command1_Click() Dim cn As Connection Dim rs As Recordset Set cn = New Connection cn. Are you saying that you check everything that you post and don't make mistakes?Quick question, new to this site, new to programming especially. I'm trying to Select data from Sql Server and then update it while it's still a recordset. You can do it specifically to the recordset you want to modify or write a more generic method that copies the source recordset. rs Original is the recordset passed in and used in code later. rs Updateable is a local recordset built as a copy of the original, then assigned to the original recordset variable.

So in this line of code, I just assign the Last Name to First Name.It is now completely updateable and changes cannot be saved back to the source table. 'clone a recordset into a new updateable recordset Dim rs Updateable As New ADODB. Field 'errors here are unlikely, but if happens I don't want to alert the user On Error Resume Next 'build the table schema For Each fld In rs Original. Value Next fld Set rs = rs Updateable 'done On Error Go To Original Error Handler 'restore error handler ...if data of room 1 changed then software automatically update the info of that room in its database.So, for students and also for freelancers its essential that they must have full command over database, and in order to understand today’s post its also essential that you must read the previous two posts of this tutorial.

Leave a Reply