How To Generate Serial No.In Data Report in VB6.0?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hnpatel
    New Member
    • Jan 2008
    • 12

    How To Generate Serial No.In Data Report in VB6.0?

    Hi To All,

    How To Generate Serial No.In Data Report in VB6.0?

    Thanx In Advance........ ............... ......
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Originally posted by hnpatel
    Hi To All,

    How To Generate Serial No.In Data Report in VB6.0?

    Thanx In Advance........ ............... ......
    Why do you mean by this? Does your data report source connected to a database? If yes, just add the PK or any unique identification to the data report. This will serve as your Serial No if you want.

    Rey Sean

    Comment

    • hnpatel
      New Member
      • Jan 2008
      • 12

      #3
      Originally posted by lotus18
      Why do you mean by this? Does your data report source connected to a database? If yes, just add the PK or any unique identification to the data report. This will serve as your Serial No if you want.

      Rey Sean
      yes my datareport source connected to a database.But what is PK? & how to add PK?

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by hnpatel
        yes my datareport source connected to a database.But what is PK? & how to add PK?
        Use Primary Key for unique iddentification and can make that field an autonuumber field to get serial number..

        Comment

        • 9815402440
          New Member
          • Oct 2007
          • 180

          #5
          hi
          what is your database? i.e. access oracle or sql etc.

          Comment

          • dnb
            New Member
            • Jan 2008
            • 34

            #6
            Originally posted by 9815402440
            hi
            what is your database? i.e. access oracle or sql etc.

            my database is access.
            but i con't want to sr. no. in datatable.
            i want to add this field external from datareport.
            plz give solution of this problem.
            thanx in advance........ ...

            Comment

            • 9815402440
              New Member
              • Oct 2007
              • 180

              #7
              hi
              the only way out is to make recordset at run time add serial no to it and then bound it to the data report

              you can add new field to the recordset as follows
              shape {select * from table1} append new adbstr srNo
              dim i as integer
              for i = 1 to rst.recordcount
              rst.fields("srN o").value = i
              next

              you can bind datareport as follows

              with dataReport1
              .datamember = ""
              set .DataSource = rst
              .sections("Deta il").controls(" fld1").datameme ber = ""
              .sections("Deta il").controls(" fld1").datafiel d = "Fld1"
              .refresh
              end with


              hope this will help you
              regards
              manpreet singh dhillon hoshiarpur

              Comment

              • dnb
                New Member
                • Jan 2008
                • 34

                #8
                Hi
                Plz Help me where to put this code and how to write a query which u have given?

                "shape {select * from table1} append new adbstr srNo" in this query there is syntex error generated.

                Plz give me proper step.

                Comment

                Working...