all groups > macromedia flash flash remoting > october 2004 >
You're in the

macromedia flash flash remoting

group:

Update String won't Work


Update String won't Work Silvertype
10/13/2004 4:36:55 PM
macromedia flash flash remoting:
Hi guys,
I have a problem with updating my database in flash remoting mx. Whenever i
try to update the table using a new value, the error below is thrown:

Operation must use an updateable query

Below's my code for updating the table called "poll.mdb". It is written in
asp.net with VB.NET:

Dim dbConn as OleDbConnection
Dim sqlStr as String
Dim objCmd as OleDbCommand
dbConn = new OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" _
& Server.Mappath("poll.mdb"))

sqlStr = "UPDATE tblPoll " _
& "SET votes = '" & lblVote.Text & "'" _
& " WHERE name = '" & lblName.Text & "'"


objCmd = New OleDbCommand(sqlStr, dbConn)
objCmd.Connection.Open()
objCmd.ExecuteNonQuery()
flash.Result = sqlStr
objCmd.Connection.close()

The strange thing is that when I try to run the same code in asp.net(the web
server that I'm using with flash remoting mx), it works! I've tried to
substitute the new values with some hard-coded values but they didn't work
either. I've also tried to modify the sql string by using the 'Insert' and
'Delete' query instead but the same error is thrown. Has any1 encountered the
same problem b4 and knows how to solve it? Any help is greatly appreciated.
Re: Update String won't Work HainKurt
10/15/2004 1:51:04 PM
can u add

sqlStr = "UPDATE tblPoll " _
& "SET votes = '" & lblVote.Text & "'" _
& " WHERE name = '" & lblName.Text & "'"

' add this line and send the result
response.write("qry : "&sqlStr)

and try running that query somewhere else.
can u send a running sample and not running sample, so we can think about it...
AddThis Social Bookmark Button