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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Search Problem...

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
I have two Adodc controls whihc link to two different databases. There is a search box (InputBox) which searches th recordset but when I try to use the Adodc control again to go through the records I get the message...

"Cannot Update '(expression)'; field not updateable"

My code is as follows:

If optImageDB.Value = True And optMovieDB.Value = False Then
StrSearch = InputBox("Enter the ID that you would like to search for....", "Image Database ID Search")

FindString = "SELECT * FROM pic_table WHERE id LIKE '" & StrSearch & "'"

rsRec.Open FindString, "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\idcnt2\db$\images.mdb", adOpenStatic, adLockReadOnly, adCmdText

txtImgID.Text = rsRec!id
txtImgCadastre.Text = rsRec!cadastre
txtImgAuthor.Text = rsRec!author
txtImgDetails.Text = rsRec!details
txtImgKeywords.Text = rsRec!keywords
txtImgPosted.Text = rsRec!posted

ElseIf optImageDB.Value = False And optMovieDB.Value = True Then
StrSearch = InputBox("Enter the ID that you would like to search for....", "Movie Database ID Search")

FindString = "SELECT * FROM movies_table WHERE id LIKE '" & StrSearch & "'"

rsRec.Open FindString, "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\idcnt2\db$\movies.mdb", adOpenStatic, adLockReadOnly, adCmdText

txtMovID.Text = rsRec!id
txtMovCadastre.Text = rsRec!cadastre
txtMovImgAuthor.Text = rsRec!author
txtMovImgDetails.Text = rsRec!details
txtMovImgKeywords.Text = rsRec!keywords
txtMovImgPosted.Text = rsRec!posted
End If

Do I need to the refresh the Adodc controls on the form?

Thanks....
 
you hve written the code below at one stage :
rsRec.Open

FindString, "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\idcnt2\db$\movies.mdb", adOpenStatic, adLockReadOnly, adCmdText

here yo read adlockreadonly. change it and try again.
another thing is that you can use adodc1.allowupdate=true. i think you will solve the problem.
 
What do you mean when you mention adlockreadonly.... do you want that taken out or changed all to lower case (which shouldn't make a difference should it?).

adodc1.allowupdate=true is also not working when I run the app.

Thanks for getting back so soon with advice ;o)

Marcus
 
I'm still having trouble with this error...

Does anyone have any ideas?

Thank you
 
Just a quick thought, but I think Polash means changing the LockType from adLockReadOnly to a lock that allows updates (e.g. adLockOptimistic).

Madlarry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top