Changing values in a recordset 
Author Message
 Changing values in a recordset

Hi there,

  I'm using VB5 and DAO.

  I have a recordset (pretty sure it's dynaset) full of integer values
that are sorted (via Order By).  Well, I want to be able to change a few
of those values but it keeps saying "database or object is read-only".

  So even if I don't ever plan on modifying the .mdb file, I still can't
change thsoe values?  Rats!  The deal is, they are sorted "wrong" for my
purposes.  I need them to be sorted as if they were strings (e.g.
1,10,11,2,3,4).  So I thought I'd just put them in a string array, do a
string sort and put their numeric values back into the recordset.  Any
way to do this???  Since I can't modify the .mdb I guess I'll have to
create another temporary one or something.

Thanks!
Brad Stone
The Salinon Corp.



Sun, 21 Jul 2002 03:00:00 GMT  
 Changing values in a recordset
Brad,

why don't you let access do the sort for you as in the example below.

SELECT Format([EmployeeID],"0000") AS Expr1
FROM Employees
ORDER BY Format([EmployeeID],"0000");

Also, why can't you change the recordset data? Is the mdb file read only;
have you got the correct privilges; has the recordset been created as a read
only recordset; is it created out of a join across muliple tables?

Liam http://www.vbexpress.com


Quote:
> Hi there,

>   I'm using VB5 and DAO.

>   I have a recordset (pretty sure it's dynaset) full of integer values
> that are sorted (via Order By).  Well, I want to be able to change a few
> of those values but it keeps saying "database or object is read-only".

>   So even if I don't ever plan on modifying the .mdb file, I still can't
> change thsoe values?  Rats!  The deal is, they are sorted "wrong" for my
> purposes.  I need them to be sorted as if they were strings (e.g.
> 1,10,11,2,3,4).  So I thought I'd just put them in a string array, do a
> string sort and put their numeric values back into the recordset.  Any
> way to do this???  Since I can't modify the .mdb I guess I'll have to
> create another temporary one or something.

> Thanks!
> Brad Stone
> The Salinon Corp.



Sun, 21 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Changes to Display values w/o changing database values

2. Recordset value changes with .update

3. Change Date values in a Recordset Coulmn

4. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

5. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

6. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

7. Updating RecordSet with values of a second RecordSet

8. combobox value: can not change value

9. Calulated fields changes control values back to original values

10. COMBOBOX.BOUNDTEXT VALUE CHANGES TO DIFFERENT FIELD VALUE

11. How to change ADO recordset retrieved from Oracle into new recordset

12. open recordset, change connection, update recordset?

 

 
Powered by phpBB® Forum Software