Am using VB.NET with Ms Access.

It worked fine before changing the field name in access database. After changing the field name i got an syntax error in catch block. And also there is no reserved words.

"Syntax Error in INSERT INTO Statement"

Here is my coding

str = "Insert into DataCaptureRecord(Ecube_Id,Resource_Name,Project_Name,Request_Type,Request_Name,Severity,Planned_Start_Dat,Planned_End_Dat,Actual_Start_Dat,Actual_End_Dat,Estimated_Request,Estimated_Analysis&Design,Estimated_Implementation,Estimated_Testing,Estimated_PeerReview,Estimated_Review,Estimated_Total,Actual_Request,Actual_Analysis&Design,Actual_Implementation,Actual_Testing,Actual_PeerReview,Actual_Review,Actual_Total) values('" & txteid.Text & "','" & cmbresname.Text & "', '" & lblproj.Text & "', '" & cmbreqtype.Text & "','" & cmbreqname.Text & "','" & cmbsev.Text & "', '" + plndstartdate.Value.Date + "', '" + plndenddate.Value.Date + "', '" + actstartdate.Value.Date + "', '" + actenddate.Value.Date + "' , '" & txtestreq.Text & "', '" & txtestana.Text & "', '" & txtesimpl.Text & "', '" & txtestest.Text & "', '" & txtespeerrev.Text & "', '" & cmbesrev.Text & "', '" & txtestot.Text & "', '" & txtactreq.Text & "', '" & txtactana.Text & "', '" & txtactimpl.Text & "', '" & txtacttest.Text & "', '" & txtactpeerrev.Text & "', '" & cmbactrev.Text & "','" & txtacttot.Text & "')"

Recommended Answers

All 2 Replies

Did you put ')' before the values in your actual code?

Did you put ')' before the values in your actual code?

Yes, I have mentioned ')' before values.

Error is actually the field name should not contain '&' after deleting that it works fine.

Thank You :-))

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.