Results 1 to 7 of 7

Thread: [RESOLVED] Data Report Error

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    11

    Resolved [RESOLVED] Data Report Error

    hi everyone! im a vb beginner and im encountering error like this: "incorrect syntax near '10001'" on my data report everytime i execute it.

    Problem: whats the correct query of my code below,'coz im trying to set my report or group it by ProdType

    Set rs = con.Execute("Select ProdNo, ProdDesc, Qty, UnitPrice, TotalAmt,Prodtype, Count(') as ProdType from tbl3DRitems where DRno = '" & Combo2.Text & "' group by ProdType")


    Can anyone give me some insight into what might be causing this problem?

    Thanks,
    ishee
    Last edited by ishee17; Mar 11th, 2009 at 10:18 PM.

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: Data Report Error

    WELCOME ishee17
    you haven't declared what is con, rs. First declare them followed by setting them.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    11

    Re: Data Report Error

    Quote Originally Posted by VBFnewcomer
    WELCOME ishee17
    you haven't declared what is con, rs. First declare them followed by setting them.

    thanks for the response and for your warm welcome!

    Last edited by ishee17; Mar 11th, 2009 at 10:11 PM.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    11

    Re: Data Report Error

    Quote Originally Posted by VBFnewcomer
    WELCOME ishee17
    you haven't declared what is con, rs. First declare them followed by setting them.

    i changed the problem.. im using ms sql8 DB.

  5. #5
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Data Report Error

    Code:
    Set rs = con.Execute("Select ProdNo, ProdDesc, Qty, UnitPrice, TotalAmt,Prodtype, Count(') as ProdType from tbl3DRitems where DRno = '" & Combo2.Text & "' group by ProdType")
    I'm not sure about that, Can You duplicate field names?

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    11

    Re: Data Report Error

    Quote Originally Posted by jggtz
    I'm not sure about that, Can You duplicate field names?

    either i duplicate it or not still the same error..
    but if some one could tell me another way of grouping records without using data environment wouldl be a great help....
    Last edited by ishee17; Mar 12th, 2009 at 01:56 AM.

  7. #7

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    11

    Re: Data Report Error

    Quote Originally Posted by ishee17 View Post
    either i duplicate it or not still the same error..
    but if some one could tell me another way of grouping records without using data environment wouldl be a great help....

    i got it now i just searched the sql syntax of group by clause.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width