Ah... there's a lot of goofiness here.
I assume you are using Microsoft SQL Server. If not, feel free to ignore the rest of this.
There are some quirks with the T-SQL engine. For example, you can 'manufacture' a field that doesn't really exist. Like this...
Code:
Select 'Hello World' As Greetings
From MyFavoriteTable
You will return a recordset with 1 column (named Greetings). There will be as many rows in the returned recordset as there are rows in the table. Every record will have the same value.
With T-SQL, there are some things that are optional. For example, the AS keyword is optional. So, the previous query could also be written as...
Code:
Select 'Hello World' Greetings
From MyFavoriteTable
By now, you probably think I'm nuts, but bear with me.
Again, with T-SQL, some spaces are not necessary, so, again the above query could be written as...
Code:
Select 'Hello World'Greetings
From MyFavoriteTable
Now, suppose you changed the column alias to
S, the query would look like...
Code:
Select 'Hello World's
From MyFavoriteTable
Now, change the data to an integer value, and for kicks, let's set it's value to 1. You end up with...
Code:
Select 1s
From MyFavoriteTable
So, you see... you returned a derived column named S with a value of 1. This is why you could retrieve its value but not set its value. Of course, I would never have a column named 1s in a table, but that's my choice, not yours. And, I certainly respect that there are circumstances when you have no choice. With that being said, here's your solution.
Change your query to:
Now, the 1s column will be returned and you will be able to update it. My favorite syntax for this would be...
RS("1s").Value = 30
you could also use...
RS![1s] = 30
Make sense?
-George
Strong and bitter words indicate a weak cause. - Fortune cookie wisdom