Current recordset does not support updating in vb6 relationship partner marriage dating site singles


This is perhaps a mistake ;-) The relevant bit of code is below: *********** Dim con Patient As Adodb. OLEDB.4.0; Data Source=C:\Documents and Settings\Rik\Desktop\My VB\NHS\patient.mdb;" con Patient. It seems perfectly happy with the file *until* it reaches the Add New; the Move First and Move Next both show the correct records in the "watch" screen. Open "select * from patient" Hope this helps, Kieron PS. Occasionally, this may be all you need and it can save you the overhead of yet another object to track.Then you need to do an Update on it when finished modifying the fields.I didn't read the code carefully though, so may have missed them. Firstly you might take a shot at changing some of your coding habits. When you are accessing recordset fields it is important to identify the field with something other than 0, 1 and 2. If the record has changed since you used the Edit method, the Update operation fails. str Message = "Edit in progress:" & vb Cr & _ " Original data = " & str Old First & " " & _ str Old Last & vb Cr & " Data in buffer = " & _ ! Last Name & vb Cr & vb Cr & _ "Use Update to replace the original data with " & _ "the buffered data in the Recordset? Microsoft Access database engine-connected ODBC and installable ISAM databases always use optimistic locking. " If Msg Box(str Message, vb Yes No) = vb Yes Then . Hi folks, I'm just starting out teaching myself VB, and so far have got on quite nicely with it. All help is very gratefully received; this has been doing my head in all day! Open SQL , dbase_connection, ad Open Dynamic, ad Lock Optimistic this is necessary to describe how to point to records (or something like that!! Look in MSDN for different values of Cursor Location, Type and Lock Type as to what is updatable or not Good Answer Stik. I'm coding a fairly simply database system; something to keep track of patients through a hospital unit. Many thanks, Rocko there possibly key elements missing = Cursor Location 'open the database to add new record conn. ) give that a whirl and see if it solves anything Hi, Your issue is that you need to specify a cursorlocation, cursortype and locktype on your recordset. Coupla minor points: You can do this is one line each for the Connection and recordset objects: 'Connect Call obj Conn.

Last Name = "Sornsin" ' Show contents of buffer and get user input. Last Name ' Delete new data because this is a demonstration. It is also required that a table ' with a primary key is used. Open Recordset( _ "SELECT * FROM roysched", db Open Dynaset, 0, _ db Optimistic Batch) With rst Temp ' Modify data in local recordset. Add Name rst Employees, str First Name, str Last Name ' Show the newly added data. If you don't use Edit first, an error occurs when you use Update or attempt to change a field's value. In an ODBCDirect workspace, you can do batch updates, provided the cursor library supports batch updates, and the Recordset was opened with the optimistic batch locking option. ********* I'm trying to get it to write to an access database as specified in my code. This may be a limitation of the provider, or of the selected recordtype.Originally I used the ADODC to manage the data, and that worked fine. Open DEFUALT_DBASE_PROVIDER & & "\Data\test.mdb" conn. You can specify these on the, or instantiate the recordset and specify them and use rs. Dim dta Patient As Recordset Set dta Patient = New Recordset dta Patient.

You must have an account to comment. Please register or login here!