1 Replies - 609 Views - Last Post: 13 February 2012 - 12:22 PM Rate Topic: -----

#1 pooja899  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-February 12

Syntax error in query

Posted 13 February 2012 - 04:17 AM

sql = "Insert Into fee(ID,year,Application_Fee,Association_fee,Course_fee,Continuation_fee,Course_u_AB,Course_p_Ab, Course_U_C,Course_P_C, Ann_U_A, Ann_P_A,Ann_dip_uA, Ann_dip_PA, Ann_U_B,Ann_P_B, Ann_Dip_UB,Ann_Dip_PB,Ann_U_C,Ann_P_C,Ann_Dip_UC,Ann_Dip_PC,enrolment_fee,total) values(" _
        & "'" & Text22.Text & "'," _
        & "'" & Combo2.Text & "'," _
        & "'" & Combo3.Text & "', " _
        & "'" & Combo4.Text & "' , " _
        & "'" & Text1.Text & "' , " _
        & "'" & Combo5.Text & "' , " _
        & "'" & Text2.Text & "' , " _
        & "'" & Text3.Text & "' , " _
        & "'" & Text4.Text & "' , " _
        & "'" & Text5.Text & "' , " _
        & "'" & Text10.Text & "' , " _
        & "'" & Text11.Text & "' , " _
        & "'" & Text12.Text & "' , " _
        & "'" & Text13.Text & "' , " _
        & "'" & Text14.Text & "' , " _
        & "'" & Text15.Text & "' , " _
        & "'" & Text16.Text & "' , " _
        & "'" & Text17.Text & "' , " _
        & "'" & Text18.Text & "' , " _
        & "'" & Text19.Text & "' , " _
        & "'" & Text20.Text & "' , " _
        & "'" & Text21.Text & "' , " _
        & "'" & Text23.Text & "' , " _
        & "'" & Text24.Text & "')"
        

my query shows syntax error whereas working ok in sql vie of access

Similarly this query has syntax error but ok in sql view
sql = "update fee set Ann_Dip_UB= '" & Text16.Text & "',Ann_Dip_PB= '" & Text17.Text & "',Ann_U_B='" & Text14.Text & "', Ann_P_B='" & Text15.Text & "',enrolment_fee='" & Text23.Text & "',Ann_dip_UA= '" & Text12.Text & "',Ann_dip_PA= '" & Text13.Text & "' ,ID= '" & Text22.Text & "', Course_p_C='" & Text5.Text & "',Continuation_fee='" & Combo5.Text & "', Ann_U_A='" & Text10.Text & "',Ann_P_A='" & Text11.Text & "',year = '" & Combo2.Text & "' ,application_fee= '" & Combo3.Text & "' ,Association_fee= '" & Combo4.Text & "',Course_fee= '" & Text1.Text & "',Ann_Dip_PC= '" & Text20.Text & "', Ann_Dip_UC= '" & Text21.Text & "' ,Course_u_AB= '" & Text2.Text & "' , Course_p_AB= '" & Text3.Text & "',Ann_P_C= '" & Text19.Text & "',total= '" & Text24.Text & "' , Course_u_C= '" & Text18.Text & "'  where ID= " & Text22.Text


This post has been edited by macosxnerd101: 13 February 2012 - 12:36 PM
Reason for edit:: Please use code tags


Is This A Good Question/Topic? 0
  • +

Replies To: Syntax error in query

#2 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: Syntax error in query

Posted 13 February 2012 - 12:22 PM

this might be a similar scenario like here.
Try the solution sela007 has provided.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1