Operation must use an updateable query--> what error is?
-
CustCMD.CommandText = "INSERT INTO QuestionDetail(QuestionDetailID,DateofCreate, " & _ " Content,TimeofQuestion,OptionType,Answer1,Answer2,Answer3,Answer4,Answer5,Result1," & _ " Result2,Result3,Result4,Result5)Values('" & _ strQuestionDetailID & "','" & txtDate.Text & " ','" & strContent & "'," & _ intTimeofQuestion & "," & chkOptionType.Checked & ",'" & strAnswer1 & "','" & _ strAnswer2 & "','" & strAnswer3 & "','" & strAnswer4 & "','" & _ strAnswer5 & "'," & chkResult1.Checked & "," & chkResult2.Checked & "," & _ chkResult3.Checked & "," & chkResult4.Checked & "," & chkResult5.Checked & ")" Try objConn.OpenCnn(strConnection) CustCMD.Connection = objConn.Conn CustCMD.ExecuteNonQuery() --------------------------- I have error message:Operation must use an updateable query. when trying to insert a record into database, can everybody tell me what error is and how to solve it. Thanks everebody very much :-D
I tried so hard and got so far
-
CustCMD.CommandText = "INSERT INTO QuestionDetail(QuestionDetailID,DateofCreate, " & _ " Content,TimeofQuestion,OptionType,Answer1,Answer2,Answer3,Answer4,Answer5,Result1," & _ " Result2,Result3,Result4,Result5)Values('" & _ strQuestionDetailID & "','" & txtDate.Text & " ','" & strContent & "'," & _ intTimeofQuestion & "," & chkOptionType.Checked & ",'" & strAnswer1 & "','" & _ strAnswer2 & "','" & strAnswer3 & "','" & strAnswer4 & "','" & _ strAnswer5 & "'," & chkResult1.Checked & "," & chkResult2.Checked & "," & _ chkResult3.Checked & "," & chkResult4.Checked & "," & chkResult5.Checked & ")" Try objConn.OpenCnn(strConnection) CustCMD.Connection = objConn.Conn CustCMD.ExecuteNonQuery() --------------------------- I have error message:Operation must use an updateable query. when trying to insert a record into database, can everybody tell me what error is and how to solve it. Thanks everebody very much :-D
I tried so hard and got so far
This is an insert statement in "update" form :-D try this one
CustCMD.CommandText = "INSERT INTO QuestionDetail('" & _ strQuestionDetailID & "','" & txtDate.Text & " ','" & strContent & "'," & _ intTimeofQuestion & "," & chkOptionType.Checked & ",'" & strAnswer1 & "','" & _ strAnswer2 & "','" & strAnswer3 & "','" & strAnswer4 & "','" & _ strAnswer5 & "'," & chkResult1.Checked & "," & chkResult2.Checked & "," & _ chkResult3.Checked & "," & chkResult4.Checked & "," & chkResult5.Checked & ")"
Tell me what happens with uBest Regards 3ala2 :)
-
CustCMD.CommandText = "INSERT INTO QuestionDetail(QuestionDetailID,DateofCreate, " & _ " Content,TimeofQuestion,OptionType,Answer1,Answer2,Answer3,Answer4,Answer5,Result1," & _ " Result2,Result3,Result4,Result5)Values('" & _ strQuestionDetailID & "','" & txtDate.Text & " ','" & strContent & "'," & _ intTimeofQuestion & "," & chkOptionType.Checked & ",'" & strAnswer1 & "','" & _ strAnswer2 & "','" & strAnswer3 & "','" & strAnswer4 & "','" & _ strAnswer5 & "'," & chkResult1.Checked & "," & chkResult2.Checked & "," & _ chkResult3.Checked & "," & chkResult4.Checked & "," & chkResult5.Checked & ")" Try objConn.OpenCnn(strConnection) CustCMD.Connection = objConn.Conn CustCMD.ExecuteNonQuery() --------------------------- I have error message:Operation must use an updateable query. when trying to insert a record into database, can everybody tell me what error is and how to solve it. Thanks everebody very much :-D
I tried so hard and got so far
Hi, I dont know but there is no space between the "Result5)" and 'values' keyword. was it by mistake?
rockxuyenmandem wrote:
Result5)Values('" & _
Also in the code you have not opened the connection. Was this by mistake or purposely not mentioned in your post ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
-
CustCMD.CommandText = "INSERT INTO QuestionDetail(QuestionDetailID,DateofCreate, " & _ " Content,TimeofQuestion,OptionType,Answer1,Answer2,Answer3,Answer4,Answer5,Result1," & _ " Result2,Result3,Result4,Result5)Values('" & _ strQuestionDetailID & "','" & txtDate.Text & " ','" & strContent & "'," & _ intTimeofQuestion & "," & chkOptionType.Checked & ",'" & strAnswer1 & "','" & _ strAnswer2 & "','" & strAnswer3 & "','" & strAnswer4 & "','" & _ strAnswer5 & "'," & chkResult1.Checked & "," & chkResult2.Checked & "," & _ chkResult3.Checked & "," & chkResult4.Checked & "," & chkResult5.Checked & ")" Try objConn.OpenCnn(strConnection) CustCMD.Connection = objConn.Conn CustCMD.ExecuteNonQuery() --------------------------- I have error message:Operation must use an updateable query. when trying to insert a record into database, can everybody tell me what error is and how to solve it. Thanks everebody very much :-D
I tried so hard and got so far
-
CustCMD.CommandText = "INSERT INTO QuestionDetail(QuestionDetailID,DateofCreate, " & _ " Content,TimeofQuestion,OptionType,Answer1,Answer2,Answer3,Answer4,Answer5,Result1," & _ " Result2,Result3,Result4,Result5)Values('" & _ strQuestionDetailID & "','" & txtDate.Text & " ','" & strContent & "'," & _ intTimeofQuestion & "," & chkOptionType.Checked & ",'" & strAnswer1 & "','" & _ strAnswer2 & "','" & strAnswer3 & "','" & strAnswer4 & "','" & _ strAnswer5 & "'," & chkResult1.Checked & "," & chkResult2.Checked & "," & _ chkResult3.Checked & "," & chkResult4.Checked & "," & chkResult5.Checked & ")" Try objConn.OpenCnn(strConnection) CustCMD.Connection = objConn.Conn CustCMD.ExecuteNonQuery() --------------------------- I have error message:Operation must use an updateable query. when trying to insert a record into database, can everybody tell me what error is and how to solve it. Thanks everebody very much :-D
I tried so hard and got so far
-
This is an insert statement in "update" form :-D try this one
CustCMD.CommandText = "INSERT INTO QuestionDetail('" & _ strQuestionDetailID & "','" & txtDate.Text & " ','" & strContent & "'," & _ intTimeofQuestion & "," & chkOptionType.Checked & ",'" & strAnswer1 & "','" & _ strAnswer2 & "','" & strAnswer3 & "','" & strAnswer4 & "','" & _ strAnswer5 & "'," & chkResult1.Checked & "," & chkResult2.Checked & "," & _ chkResult3.Checked & "," & chkResult4.Checked & "," & chkResult5.Checked & ")"
Tell me what happens with uBest Regards 3ala2 :)
Thanks for replying me, but it still error with message: Syntax error in INSERT INTO statement.
I tried so hard and got so far
-
Hi, I dont know but there is no space between the "Result5)" and 'values' keyword. was it by mistake?
rockxuyenmandem wrote:
Result5)Values('" & _
Also in the code you have not opened the connection. Was this by mistake or purposely not mentioned in your post ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
Of course, I have opened connection, I also include the space between the "Result5)" and 'values' keyword, but it still error with the same message :((
I tried so hard and got so far
-
Are you using an Access database? Then you haven't set write permission on the file for the user account that is running the code.
--- b { font-weight: normal; }
I use Access database and i have setted the full control permission, but nothing is change, still error :((
I tried so hard and got so far
-
Are you using Access Database? Check if its read only. It should not be readonly. Hope This Works...
Yes I am using Access database, I can't unset the readonly, because i uncheck Readonly option of the project folder, but when I view the property of the folder again, It still Readonly :((
I tried so hard and got so far
-
I use Access database and i have setted the full control permission, but nothing is change, still error :((
I tried so hard and got so far
-
Which user account have you given full permission? The ASP.NET code is usually run under the IIS_WPG or ASPNET account.
--- b { font-weight: normal; }
I have setted all account include IIS_WPG and ASPNET with full permission, but nothing is changed :((
I tried so hard and got so far