Forums

This topic is locked

Unique key for update record

Posted 11 Sep 2001 11:59:47
1
has voted
11 Sep 2001 11:59:47 Simon Wilkinson posted:
The update record behaviour doesn't seem to like my datetime column as the unique key column.
(i know you shouldn't use a datetime column as a unique key but in this case it is indexed unique - plus i'm using sql 6.5 which doesn't have autoid)

1 Is there a modified behaviour available which handle non-unique columns.

2 Or as in most update scenarios something which handles multiple columns as the unique filter.

3 Or as i'm a beginner with this fantastic development tool how could i hand code the problem.

4 Or is there an answer on these great forums which I haven't found yet?

I'm greatful for any help!

Replies

Replied 11 Sep 2001 18:41:19
11 Sep 2001 18:41:19 Joel Martinez replied:
If the update SB doesn't do it, I don't know of any extension that can handle multiple column update, but here's a script that you shouldbe able to modify<pre id=code><font face=courier size=2 id=code>&lt;%
set conn = server.createobject("adodb.connection"
conn.open yourConnString
sql = "UPDATE table SET field1="& request("field1" &", field2="& request("field2" &" WHERE col1=25 AND col2 LIKE 'charlie'"
conn.execute sql
conn.close
set conn = nothing
%&gt;</font id=code></pre id=code>

Joel Martinez [ ]
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
'2nd place is just 1st Loser
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Replied 12 Sep 2001 13:44:58
12 Sep 2001 13:44:58 jean-christophe jcf replied:
in : update... set variables
line : MM_recordId
add just like :
MM_recordId = "'" + Request.Form("MM_recordId" + "'" + " and code = '" + Request.Form("code" +"'"


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
The update record behaviour doesn't seem to like my datetime column as the unique key column.
(i know you shouldn't use a datetime column as a unique key but in this case it is indexed unique - plus i'm using sql 6.5 which doesn't have autoid)

1 Is there a modified behaviour available which handle non-unique columns.

2 Or as in most update scenarios something which handles multiple columns as the unique filter.

3 Or as i'm a beginner with this fantastic development tool how could i hand code the problem.

4 Or is there an answer on these great forums which I haven't found yet?

I'm greatful for any help!


<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Reply to this topic