|
-
Jul 5th, 2001, 04:46 AM
#1
UPDATE statment
Im using the update statment to change some values in my DB
VB Code:
SQLupdate = "UPDATE FILE_ID (ID1, ID2, ID3) VALUES (42, 34, 34)"
CN.Execute SQLupdate
My question is how do I select which record to update? I already have a recordset open at the record I want with this...
VB Code:
Set rsFiles = Server.CreateObject("ADODB.Recordset")
rsFiles.Open "SELECT * FROM FILE_ID WHERE ID1=23" , CN, 3, 3
-
Jul 5th, 2001, 05:02 AM
#2
This is how you can use the UPDATE statement.
Code:
UPDATE MyTable SET MyInt=(1), MyStr=('mystr') WHERE MyID=1;
-
Jul 5th, 2001, 05:05 AM
#3
Would mine be ok if I just added "WHERE ID=23" on the end
-
Jul 5th, 2001, 05:32 AM
#4
Code:
"UPDATE FILE_ID (" & _
"ID1, ID2, ID3" & _
") VALUES (" & _
"32, 43, 54" & _
") WHERE ID1=23"
Whats wrong with this, I get a error....
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/simon/asp/sub.asp, line 89
-
Jul 5th, 2001, 07:01 AM
#5
Fanatic Member
That syntax is for an Insert statement, try changing to this:
Code:
"UPDATE FILE_ID Set ID1 = 32, ID2 = 43, ID3 = 54 " & _
"WHERE ID1=23"
Regards,
Chris
-
Jul 5th, 2001, 04:42 PM
#6
ah cheers 
I used this anyway 
SQL = "UPDATE FILE_ID Set ID1 = 32 WHERE ID1=23"
CN.execute SQL
SQL = "UPDATE FILE_ID Set ID1 = 32 WHERE ID2=32"
CN.execute SQL
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|