Click here to Skip to main content
15,437,015 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
JokeRe: Power beep Pin
Julien Villers22-Sep-11 22:06
professionalJulien Villers22-Sep-11 22:06 
GeneralRe: Power beep Pin
Lutosław22-Sep-11 22:53
MemberLutosław22-Sep-11 22:53 
GeneralRe: Power beep Pin
Sander Rossel24-Sep-11 3:24
professionalSander Rossel24-Sep-11 3:24 
GeneralRe: Power beep Pin
Pravin Patil, Mumbai25-Sep-11 19:40
MemberPravin Patil, Mumbai25-Sep-11 19:40 
GeneralGuess it does not contains 'Contains' Pin
VallarasuS22-Sep-11 1:37
MemberVallarasuS22-Sep-11 1:37 
GeneralRe: Guess it does not contains 'Contains' Pin
Nagy Vilmos22-Sep-11 1:46
professionalNagy Vilmos22-Sep-11 1:46 
GeneralRe: Guess it does not contains 'Contains' Pin
VallarasuS22-Sep-11 2:02
MemberVallarasuS22-Sep-11 2:02 
GeneralAnother GoTo Hell Pin
Rob Grainger21-Sep-11 5:22
MemberRob Grainger21-Sep-11 5:22 
This really takes the biscuit, just wrong on so many levels...

VB
Private Function utilCheckSecurity(recSet As DAO.Recordset, userSet As DAO.Recordset, fileNo As String) As Integer

    On Error GoTo errorCUS

    If fileNo = "3" Then GoTo utilCSUpdate  ' no secclass on table

    If IsNull(recSet![SecurityClass]) Then GoTo utilCSUpdate

    If Len(recSet![SecurityClass]) = 0 Then GoTo utilCSUpdate

    If recSet![SecurityClass] Like userSet![updateclass] Then GoTo utilCSUpdate

    If recSet![SecurityClass] Like userSet![readclass] Then GoTo UtilCSRead

    utilCheckSecurity = 0  ' We fail
    Exit Function

UtilCSRead:

    utilCheckSecurity = 1    ' Can only read the record
    Exit Function

utilCSUpdate:
    utilCheckSecurity = 2    ' Can update the record
    Exit Function

errorCUS:
    If Err = 3265 Then Resume utilCSUpdate ' no security field
    message "Error " & Format(Err, "######") & " " & Error, "UtilCheckSecurity"
    Exit Function
End Function

GeneralRe: Another GoTo Hell Pin
Nagy Vilmos21-Sep-11 5:39
professionalNagy Vilmos21-Sep-11 5:39 
GeneralRe: Another GoTo Hell Pin
Rob Grainger22-Sep-11 5:40
MemberRob Grainger22-Sep-11 5:40 
GeneralRe: Another GoTo Hell Pin
StM0n22-Sep-11 7:49
MemberStM0n22-Sep-11 7:49 
GeneralRe: Another GoTo Hell Pin
Stefan_Lang30-Sep-11 4:05
mveStefan_Lang30-Sep-11 4:05 
GeneralRe: Another GoTo Hell Pin
Allan Thomas23-Sep-11 19:40
MemberAllan Thomas23-Sep-11 19:40 
GeneralSqlConnection Object in Session and President/CEO's 'vacuum claim' Pin
Vasudevan Deepak Kumar9-Sep-11 5:35
MemberVasudevan Deepak Kumar9-Sep-11 5:35 
JokeRe: SqlConnection Object in Session and President/CEO's 'vacuum claim' Pin
Julien Villers9-Sep-11 6:24
professionalJulien Villers9-Sep-11 6:24 
GeneralRe: SqlConnection Object in Session and President/CEO's 'vacuum claim' Pin
Vasudevan Deepak Kumar9-Sep-11 7:23
MemberVasudevan Deepak Kumar9-Sep-11 7:23 
GeneralRe: SqlConnection Object in Session and President/CEO's 'vacuum claim' Pin
RobCroll13-Sep-11 16:53
MemberRobCroll13-Sep-11 16:53 
GeneralRe: SqlConnection Object in Session and President/CEO's 'vacuum claim' Pin
fjdiewornncalwe14-Sep-11 3:33
professionalfjdiewornncalwe14-Sep-11 3:33 
GeneralIs this the case to select case? Pin
Alberto Biasiutti8-Sep-11 6:07
MemberAlberto Biasiutti8-Sep-11 6:07 
GeneralRe: Is this the case to select case? Pin
RCoate8-Sep-11 12:27
MemberRCoate8-Sep-11 12:27 
GeneralRe: Is this the case to select case? Pin
Alberto Biasiutti8-Sep-11 20:46
MemberAlberto Biasiutti8-Sep-11 20:46 
GeneralRe: Is this the case to select case? Pin
BotCar8-Sep-11 23:54
MemberBotCar8-Sep-11 23:54 
GeneralRe: Is this the case to select case? Pin
Alberto Biasiutti9-Sep-11 2:42
MemberAlberto Biasiutti9-Sep-11 2:42 
GeneralRe: Is this the case to select case? Pin
V.9-Sep-11 2:12
professionalV.9-Sep-11 2:12 
GeneralRe: Is this the case to select case? Pin
Alberto Biasiutti9-Sep-11 3:00
MemberAlberto Biasiutti9-Sep-11 3:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.