Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing and Deleting after a search?

Status
Not open for further replies.

GuntherKS

MIS
Nov 13, 2000
13
US
I have successfully created a page that can step through a database with a navbar. I can then edit or delete the item that I am at. This is all done with design time controls.

I now would like to be able to search by name. I have made this work by using a script that takes a txtbox variable and changes the SQL Statement of a Recordset, but when it brings up the new record that it finds, I can't edit or delete this item. It throws back an error:

Microsoft OLE DB Provider for Oracle (0x80040E2F)
ORA-00001: unique constraint (DBAWEBADMIN.ACCOUNT_PK) violated
/itsdba/_ScriptLibrary/Recordset.ASP, line 311

Also, if I try and use the navbar after searching, it starts over at the beginning (goes back to the letter A of the alphabet). I would like to be able to step from the point it was at, and be able to edit and delete items I have searched for.

Seems to me it is some sort of cursor problem? I could use some suggestions, I am stuck.

Thanks,
Kevin
 
Kevin,

> ORA-00001: unique constraint (DBAWEBADMIN.ACCOUNT_PK) violated

If the message is accurate your update is attemting to modify data that would create a duplicate index value in the table. That is not allowed in most modern RDBMS's

-pete
 
I realize that I can't create a duplicate primary key, but the question I have is, I can do the exact same update if I scroll to it through the navbar. As soon as I use the search script to find a record I get this error. Why does it give me this error when searching, but not when using the navbar to find the record? I am using this script for the search:

Sub btnNameSearch_onclick()
rsITSxxx.close
newSQL = "Select * from itsxxx where account_name like '%" & tbNameSearch.value & "%' order by account_name"
rsITSxxx.setSQLText(newSQL)
rsITSxxx.open
End Sub

thanks for the input,
Kevin
 
I have figured out my error. In the RecordSet, the automatically open the recordset check box was checked. I unchecked it and all is well.

Thanks for replying. Hopefully this might help someone else out there.

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top