|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Only First Record Updating
Hello,
For some reason I am having troubles getting my database to update a specific record. I do not receive any errors, but my when I download my database from the server, it shows the first record updated, not the specific record. Any suggestions? My code is as follows: Code:
dim i, purchasinguse, eacrid
i = 1
purchasinguse = Request.Form("purchasinguse" & i)
eacrid = Request.Form("eacrID")
bsql = "SELECT * FROM ItemDetails WHERE ID = " & eacrid
rs2.open bsql, conn, adOpenDynamic, adLockReadOnly, adCmdText
rs.open "Eacr", conn, adOpenKeySet, adLockOptimistic, adCmdTable
rs.update
rs("PurchasingUseID") = purchasinguse
rs("PurchasingUseDate") = Request.Form("puse_date")
rs.update
rs.close
Thanks! Last edited by peachsoda03 : December 11th, 2003 at 01:37 PM. |
|
#2
|
|||
|
|||
|
Are you sure that you aren't a least updating the first record in the table?
S- |
|
#3
|
|||
|
|||
|
Aye, I have finally figured out how to get the two fields (purchasinguseID & purchasinguseDate). However, only the first record is updated, rather than the specified record (Ex: Form #43). I have NO clue what is wrong with my code....
Code:
dim i
i = 1
asql = "SELECT ID FROM EACR WHERE ID = " & Request.Form("eacrID")
rs.open "Eacr", conn, adOpenKeySet, adLockOptimistic, adCmdTable
rs.update
rs("PurchasingUseID") = Request.Form("purchasinguse" & i)
rs("PurchasingUseDate") = Request.Form("puse_date")
rs.update
rs.close
Any help is *greatly* appreciated! ![]() |
|
#4
|
|||
|
|||
|
Fix the following statement
asql = "SELECT ID FROM EACR WHERE ID = " & Request.Form("eacrID") SHOULD BE asql = "SELECT PurchasingUseID, PurchasingUseDate FROM EACR WHERE ID = " & Request.Form("eacrID") Also fix the next statement rs.open "Eacr", conn, adOpenKeySet, adLockOptimistic, adCmdTable SHOULD BE rs.open asql, conn, adOpenKeySet, adLockOptimistic, adCmdTable |
|
#5
|
|||
|
|||
|
Ah ha! Thanks so much for your help!
![]() |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > DB Not Updating |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|