Announcement

Collapse
No announcement yet.

NT Service PB or VC++

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NT Service PB or VC++

    All,

    I am in the process of selecting a tool to build an NT Service
    which will read databases via OLE DB or ODBC. I was wondering if
    anyone has built one with both PB and VC++.

    I am not interested in starting or engaging in a religious battle
    over which tool or language is better. My focus is on the pros and
    cons of building NT Services with each tool.

    Thanks,

    Josh F.



    ------------------




    [This message has been edited by Josh Forster (edited March 21, 2001).]

    #2
    Hi

    If you want to use OLE DB with PB then you'll have to use Philip Monteil's
    very good 3rd Jazzage software at http://www.jazzagesoft.com/ or roll
    your own COM access (without ATL or MFC support)

    I use ODBC myself - and with PB you can either use the ODBC API
    directly or use PerfectSync's SQLTools (it's had nothing but
    excellent reviews) found at: http://www.perfectsync.com/

    As to your question about the pros and cons of using VC++ or
    PB to build services the quite short answer is as follows:

    If you don't mind the bigger executables that VC++ produces
    and feel comfortable using the ATL COM framework then the ATL
    wizard will quickly set up a service project for you with hooks
    for the different methods etc.

    With PB you'll have to code it by hand. I prefer coding it by hand
    and with experience I find it's often faster.

    The short answer is: code it in whatever language you feel most
    comfortable using.

    I personally like lean and mean which means I'd code it in PB.

    YMMV of course

    Cheers


    Florent




    [This message has been edited by Florent Heyworth (edited March 21, 2001).]

    Comment


      #3
      I've done services in both PB, C, and C++, and while
      the grunt work of string handling, etc. is easier in
      PB, there are far more samples in C. As to which was
      easier, for me it was C, but only because the first one
      I ever tried was in PB, and I had a steep learning
      curve. By the time I did one in C, I'd figured out most
      of the stickiness so it went a lot smoother. I haven't
      since coded another one in PB, but only because my
      current employer insists on C++.

      Just knowing the little bit about your project, and
      owning the tools I've already paid for, I'd do it in PB
      with SQL Tools. If I didn't own SQL Tools, I'd use C
      because I have generic wrapper code for ODBC and
      wouldn't want to convert that to PB. In other words,
      it's the ODBC part that would determine which language
      I used rather than the NT Service part. I find the ODBC
      API intensely more complex than the NT Service API, but
      that's just me. To tell you how much I hate ODBC without
      SQL Tools, I use DBLIB rather than ODBC if I have to
      work in C or C++. DBLIB is *way* easier than ODBC, but
      of course it's now deprecated. I also think you'll find
      that OLE DB performance isn't up to par with ODBC.

      When I built my service frameworks in both C and C++, I
      didn't have to use ATL/COM at all, so didn't have to
      get bogged down with those difficulties. (I've never
      coded COM with PB, C, or C++, only in VB). I just
      followed the API for services, which is pretty
      straight-forward. The sad part is, I'd be more than
      happy to give you that source, but it's owned by my
      past employer (PB Version) and current employer (C and
      C++ versions).




      ------------------
      Troy King
      [email protected]
      Troy King
      katravax at yahoo dot com

      Comment


        #4
        Florent,

        It is difficult choosing between the two because I have a
        feeling eventually someone will come along and want to buy
        the source code. You can guess where I'm going with this.
        Some unknowledgeable people will not even know Powerbasic
        exists. Unfortunately, these people believe "everything" is
        written in C. This may put me at a disadvantage.


        Troy,

        I have a general question for you. How would you rate the
        database access speed given the following?

        My wild guesses are in parenthesis.

        ODBC - 100%
        ODBC-SQL Tools -???% (Would this be around 120%?)
        OLE DB - ???% (Would this be around 170%?)
        ADO - ????% (Would this be around 200%?)

        I know these are sweeping generalizations. However, I was
        just looking for a ballpark figure.

        Have you ever used SQL Tools with C/C++?


        Florent & Troy,

        I really appreciate both of you taking time to post feedback.

        Thanks,

        Josh


        ------------------

        Comment


          #5
          Josh --

          > ODBC - 100%
          > ODBC-SQL Tools -???% (Would this be around 120%?)

          SQL Tools adds very little overhead, nowhere near 20%. In fact, since you would have to write code to take the place of the SQL Tools functions ("open database", etc.) it's possible that your own "pure" ODBC code would be slower than SQL Tools. We spent a lot of time optimizing it.

          > Have you ever used SQL Tools with C/C++?

          The SQL Tools documentation is heavily weighted toward PowerBASIC, but the SQL Tools DLL itself is a 100% standard Win32 DLL that is compatible with virtually all Windows programming languages. If you are familiar with both C and PowerBASIC (differences in data types, etc.) then you should have no problem.

          -- Eric


          ------------------
          Perfect Sync Development Tools
          Perfect Sync Web Site
          Contact Us: mailto:[email protected][email protected]</A>
          "Not my circus, not my monkeys."

          Comment


            #6
            Eric wrote:
            SQL Tools adds very little overhead, nowhere near 20%.
            In fact, since you would have to write code to take the place
            of the SQL Tools functions ("open database", etc.) it's possible
            that your own "pure" ODBC code would be slower than SQL Tools.
            We spent a lot of time optimizing it.
            Thanks, Eric! You just made my data access decision easy.

            Could I lobby for a type library for SQL Tools to use in the
            COM tools (Delphi, C++ Builder, VC++ and VB)?

            Josh

            ------------------

            Comment


              #7
              I would suggest that you check out Jason Bock's website. He has
              kindly posted powerbasic source code for an NT Service. The link to
              his site is as follows: http://www.execpc.com/~jrbock/

              You will need to look in the programming section for this code.

              Chris

              ------------------

              Comment


                #8
                see:
                http://www.powerbasic.com/support/pb...ad.php?t=22982

                ------------------
                peter.
                mailto[email protected][email protected]</a>
                Regards,
                Peter

                "Simplicity is a prerequisite for reliability"

                Comment


                  #9
                  I thought ADO and OLE DB was the same thing!!!



                  ------------------
                  Paul Dwyer
                  Network Engineer
                  Aussie in Tokyo

                  Comment


                    #10
                    Josh:
                    My rating would be more like this:
                    ODBC-SQL Tools: 100%
                    ODBC - 110 - 200% (if not an ODBC expert)
                    OLE DB - 110% - 150%
                    ADO - About 5% more on top of OLE DB.

                    I did some speed tests about a year ago at my previous employer,
                    and I think those are about the numbers I came up with across a
                    broad sprectrum of trials. Frankly, ODBC is so ungodly
                    complicated when you're trying to write generic code, it would
                    be next to impossible, in my opinion, to approach the speed of
                    SQL Tools. In some cases, however, DBLIB is faster. However, DBLIB
                    has been deprecated, and in cases with extremely large result sets,
                    I find it slower than ODBC. I did not locate the exact break point,
                    but a particular 2 million-row result set I work with regularly
                    took about 50% longer with DBLIB. Sets smaller than a couple
                    thousand rows were quicker, though.

                    Also, I have not used SQL Tools from C or C++, but you've given
                    me a hell of an idea . I wonder if Eric has conversions of the
                    header files .

                    Paul: ADO is another library on top of OLE DB.


                    While I think Bock is an awesome programmer, and certainly more
                    skilled than myself, that particular NT Service implementation
                    is a bit lacking. It would be highly handy for using as a basis,
                    though, and seeing how some of the conversions are done.



                    ------------------
                    Troy King
                    [email protected]
                    Troy King
                    katravax at yahoo dot com

                    Comment


                      #11
                      Troy,

                      While I think Bock is an awesome programmer, and certainly more
                      skilled than myself, that particular NT Service implementation
                      is a bit lacking. It would be highly handy for using as a basis,
                      though, and seeing how some of the conversions are done.
                      I appreciate the compliment . I would like to make one small comment. The NT service code I wrote for PB is supposed to be just boilerplate code. If there's something else you'd like to see added to it, I'd be willing to add it to the BAS file (when I have the time ).

                      Regards,

                      Jason

                      ------------------

                      Comment


                        #12
                        ...I would like to make one small comment. The NT service
                        code I wrote for PB is supposed to be just boilerplate code.
                        If there's something else you'd like to see added to it,
                        I'd be willing to add it to the BAS file...
                        Jason, I feel like a jerk. I didn't realize how rude that sounded
                        when I wrote it. I'm sorry. I never would have figured out NT
                        Services to start with if it weren't for your code.



                        ------------------
                        Troy King
                        [email protected]
                        Troy King
                        katravax at yahoo dot com

                        Comment


                          #13
                          Troy,

                          Hey, no problem - I didn't take the statement as such.

                          Regards,

                          Jason

                          ------------------

                          Comment

                          Working...
                          X
                          😀
                          🥰
                          🤢
                          😎
                          😡
                          👍
                          👎