Results 1 to 14 of 14
  1. #1
    Join Date
    Feb 2007
    Posts
    348

    Unanswered: Code Bank Upload question

    I recently started using a chunk of code that comes directly from a book. It's not mine and I haven't really modified it in any meaningful way. I think it would be valuable in the codebank. Does anyone have a suggestion as to what I need to do to make it ok for the codebank? Should I try to contact the books author?

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    Somewhere in the book, or in the actual code, there are usually a Copyright notice, which explains what you can and cannot do.

    Mostly, you are allowed to use it in your application, but not pass it off as your own - i e - keep the copyright notice, and not sell it separately, not post it on other websites etc. Often such samples are availble on the net somewhere, too, then it's appropriate to link to them, but not copy/paste.

    See for instance some of the code samples from TheAccessWeb, like
    http://www.mvps.org/access/api/api0001.htm
    http://www.mvps.org/access/api/api0002.htm
    ...

    Edit: if you cant find any such sample on the net, then perhaps contact the author, and ask for permission
    Last edited by RoyVidar; 10-27-07 at 13:44.
    Roy-Vidar

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Asking the author is always the best way. See www.r937.com/relational.html for a good example of an authorised "re-production" article.
    George
    Home | Blog

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    A lot of times the author and comments can get lost in the spreading around of code. There are many examples of coding snippets where a piece of the code was copied without the authors comments, especially if it's tweaked (I've got lots of coding snippets I've copied from one source or another which didn't have any authoring and I've gone on to tweak it in some way or another.)

    Does that mean though that the code cannot be used or passed on to others?

    I agree that if possible an attempt should be made to find the author and put in comments giving credit to the author but not having the author's signature in the code hasn't really been a deciding factor for me if I should use the code or not. I'm guessing everyone of us has some code or another where the proper author's signature isn't in the code (even though we should find out and put it in.)

    Besides, anyone can look at the code/forms I've designed and almost immediately tell pkstormy designed that (or that I've tweaked it.) I can look at other people's code at work and usually tell who designed it by looking at the screens/code. It's almost funny in a way that like reading a book you can tell the author simply by the way they wrote it.
    Last edited by pkstormy; 10-27-07 at 17:37.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Here's a fun trivia question:

    See if you can tell who wrote this code I randomly picked out from the code bank (without the author comments.) The author should recognize it immediately:

    Private Sub Command0_Click()
    Dim MeSg As String
    Dim GuidVar As Integer

    On Error GoTo Err_click

    'If the reference is NOT empty then...
    If Not IsNull(Me.txtGUID) Then
    'assign the entered reference to a variable
    GuidVar = txtGUID
    'produce the messagebox - not that Chr(9) = Tab and Chr(13) = Carriage return
    MsgBox "Number:" & Chr(9) & Chr(9) & GuidVar & Chr(13) & _
    "Name:" & Chr(9) & Chr(9) & Application.References(GuidVar).Name & Chr(13) & _
    "GUID:" & Chr(9) & Chr(9) & Application.References(GuidVar).GUID & Chr(13) & _
    "BuiltIn:" & Chr(9) & Chr(9) & Application.References(GuidVar).BuiltIn & Chr(13) & _
    "FullPath:" & Chr(9) & Chr(9) & Application.References(GuidVar).FullPath & Chr(13) & _
    "IsBroken:" & Chr(9) & Chr(9) & Application.References(GuidVar).IsBroken & Chr(13) & _
    "Kind:" & Chr(9) & Chr(9) & Application.References(GuidVar).Kind & Chr(13) & _
    "Major:" & Chr(9) & Chr(9) & Application.References(GuidVar).Major & Chr(13) & _
    "Minor:" & Chr(9) & Chr(9) & Application.References(GuidVar).Minor & Chr(13), vbOKOnly, "GUID Information"
    'comment
    Me.txtGUID.SetFocus
    Else
    MsgBox "Please enter a reference number"
    End If

    Exit_click:
    Exit Sub

    Err_click:
    If Err.Number = 452 Then
    MsgBox "The reference you entered is not in use"
    Resume Next
    ElseIf Err.Number = 13 Then
    MsgBox "Invalid reference choice"
    Resume Next
    End If

    MsgBox "Error number: " & Err.Number & Chr(13) & _
    "Error description: " & Err.Description
    GoTo Exit_click

    End Sub
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    Where to draw the line - some views.

    Snippets that are given in reply to specific questions, are posted in the public domain, and as such, I don't think there are, or should be, any restrictions on reusage of those.

    Except - let's say you collect snippets by various authors given in reply to specific posts, put them into some kind of order (database, document...), then post it in another context, say as "your own" tips, with or without acknowledging the originators (or asking for permission), then I'm not sure. It is both out of context, and "out of the originators control", so such usage cannot be said to be the intention of the actual reply or snippet. If those snippets exist on the web, I think a link to the code is better/more appropriate than copy/paste.

    If reposting a snippet collected from somewhere, I think it would be nice to mention the originator, if known, or "I know I picked this from somewhere, but I don't remember from where..." (see for instance http://www.mvps.org/access/forms/frm0024.htm)

    Lot of very competent developers have used lot of time creating samples and workarounds for common Access issues. Such is perhaps published/posted in books, magazines, on the developers own site/pages, other sites like for instance TheAccessWeb. Usually they will contain some copyright information, where the most common is that you can freely use the code as part of your application, but not redistribute it in any other form than as part of your application, with originator/copyright info intact. Often such code is tested in different environments, found bug free, or have some version specific disclaimers etc.

    Linking to the actual code/page (or book/article), if it exists, is OK, but copy/pasting it violates the terms of usage of the originators. What the actual rights the originators of such code has, unless it is part of a published book or article, might of course be topic of discussion, but my view is to respect and honour the effort of the originators by following their wish or terms of usage.

    Also, the world changes, so does Access versions and the knowledge of developers. Often the originator of an article or method, will maintain the information, add additional information, amend due to changes in version etc in the original article, while all the copy/pasted copies around the world will be left unchanged ("multiple versions of the truth").

    Often also it is very easy to find out the originator by studying the code. Most of us use naming conventions, coding styles etc, that can make it quite easy to identify code.

    For instance the code you posted, is posted here by georgev in february this year
    Roy-Vidar

  7. #7
    Join Date
    Feb 2007
    Posts
    348
    PK,
    I'm afraid I don't personally have enough experience on the site to pick that one out. It doesn't look, to me, like the stuff I have seen from you. I'm gonna guess it's not GeorgeV...

    d'oh, just saw that Roy named it as George.


    I dug out the book I was referring to and looked at the Preface, it states
    "This book is here to help you get your job done. In general, you can use the code in this book in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from the book into your product's documentation does require permission."
    So I read that to mean that if I want to post a single or a couple examples out of this book, as long as I cite it, we're cool. If I wanted to post half the code or say it's all mine, not cool. So I think I'm gonna go ahead.

  8. #8
    Join Date
    Feb 2007
    Posts
    348
    HA, I had looked through the codebank before but I wanted to look one more time before I added it. I found a variation on the code, already there. It was the shift bypass disabling code, page four as I recall. I had a version of that from the Access Hacks by O'Reilly.

    Thanks for the suggestions. I'll bear them in mind as I come up with more.

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    It's pretty easy to spot the stuff I've done. I always use cartoonish type coloring on my forms (never was much of an art student for colors.) I can usually pick out my code from the past as Royvidar states, everyone has their own way they define variables and ways they write their code. I can pretty much tell who coded anything here at work by looking at their code/screens.

    Code - Correct - The snippet is from the post George made for a GUID.zip example found here: http://www.dbforums.com/showpost.php...7&postcount=16.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I must have written that a while ago - I code very differently now.
    Well, I say very, I actually mean slightly

    You could have at least retained my pretty formatting using the [CODE] tags
    George
    Home | Blog

  11. #11
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Ha! You're right, I plagurized it a tad by not including code tags.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  12. #12
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    I found it here http://www.dbforums.com/showthread.php?t=1615228 - and true, one does change style over time. I take it as a sign I'm still learning
    Roy-Vidar

  13. #13
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Yep.
    The best thing about programming is that you will never know it all!
    George
    Home | Blog

  14. #14
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I believe this is the relevant part of your book's disclaimer:

    ... Answering a question by citing this book and quoting example code does not require permission.
    In this context, we post code samples for the purpose of answering other people's questions. Just make sure the source is cited.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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