Set a Field of Recordset to be editable

A

ANC

hi,

i would like to ask how can i set a field of recordset to be editable?
thanks in advance.

ANC
 
K

Ken Schaefer

Do not use an adLockReadOnly locktype.

Cheers
Ken

: hi,
:
: i would like to ask how can i set a field of recordset to be editable?
: thanks in advance.
:
: ANC
:
:
 
J

John Beschler

I'm surprised nobody else here has brought this up: You
shouldn't!

Assuming you are using SQL or Access, you should update
your data with an SQL UPDATE statement.


IE

UPDATE MYTable SET MyTextField = 'somevalue',
MyNumberField = somenumber
WHERE MyKey = SomeKeyValue

HTH,
John
 
K

Ken Schaefer

A recordset could be, for example, disconnected from the database - using an
UPDATE statement in such a case is pointless.

I suppose we just don't know what the OP is trying to do!

Cheers
Ken

: I'm surprised nobody else here has brought this up: You
: shouldn't!
:
: Assuming you are using SQL or Access, you should update
: your data with an SQL UPDATE statement.
:
:
: IE
:
: UPDATE MYTable SET MyTextField = 'somevalue',
: MyNumberField = somenumber
: WHERE MyKey = SomeKeyValue
:
: HTH,
: John
:
:
:
: >-----Original Message-----
: >Do not use an adLockReadOnly locktype.
: >
: >Cheers
: >Ken
: >
: >: >: hi,
: >:
: >: i would like to ask how can i set a field of recordset
: to be editable?
: >: thanks in advance.
: >:
: >: ANC
 
A

ANC

ken, thanks for the advice.



Maybe i'm not making clear to my question, sorry about that.



I created a recordset and put it in a table. User can edit some of the field
on the table.

however, my table is all protected, i don't know how to make it editable by
user.

or is it possible to do this?!



John, please read the question carefully even u're trying to solve my
problem,

of coz i'm not asking how to write the update script with sql statement.



Thanks,

Anthea
 
J

John Beschler

OK, Now I'm really confused. When you say "I created a
recordset and put it in a table." Do you mean an HTML
table in your web page, or a table in your database?

If you mean an HTML table in your web page, then you would
have to replace the values in your table with input tags
and process the page accordingly.

If you mean a table in your database, then you need to let
us know which database you are using (MS-SQL, MS-Access,
mySql, Oracle, etc.)

HTH,
John
 
A

ANC

the recordset is put into an HTML table and user can edit some of the field
on the web, and they press submit button,
then i will update the data by script.
but now i can't make my HTML table to be editable.

Thanks for reading my problem.

Anthea

"John Beschler" <[email protected]> ???
???...
OK, Now I'm really confused. When you say "I created a
recordset and put it in a table." Do you mean an HTML
table in your web page, or a table in your database?

If you mean an HTML table in your web page, then you would
have to replace the values in your table with input tags
and process the page accordingly.

If you mean a table in your database, then you need to let
us know which database you are using (MS-SQL, MS-Access,
mySql, Oracle, etc.)

HTH,
John
 
J

John Beschler

So what you have is:
<table>
<tr>
<td>Data from my field 1</td>
</tr>
<tr>
<td>Data from my field 2</td>
</tr>
....
</table>

Is this correct? And you want to be able to edit that data?

Then you would need something like this:

<form name=myform action=update.asp method=post>


<table>
<tr>
<td><input type=text name=txtfield1 value="Data from my
field 1"></td>
</tr>
<tr>
<td><input type=text name=txtfield2 value="Data from my
field 2"></td>
</tr>
<tr>
<td>
<input type=submit value="Submit">
</td>
</tr>
....
</table>
</form>

Then, you have to write the code for update.asp to process
the data when it gets back to the server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top