Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

Burnsys2

@Burnsys2
About
Posts
21
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Design time UserControls
    B Burnsys2

    Hi, i am creating a Winforms UserControl that has a splitcontainer and a couple of labels and textboxes, in the left panel of the splitcontainer are the lables and the textboxes in the right panel, What i want is to be able to change the spliter distance in desing time with the mouse, not changing the property. all i get now when i drag my usercontrol in a new form is a static picture of my control, and i can't interact with it's contents in any way. How could i do that? Thanks in advance

    Visual Basic csharp winforms design question

  • Another from my boss!
    B Burnsys2

    The database server doesn't exists anymore, and the sa psw is encripted in the code!

    The Weird and The Wonderful database help question career

  • Another from my boss!
    B Burnsys2

    Yheaaa! but without this public keys:

    Public Const OLZ_A1 = "70535728307717681704418679379687594365276559462962642627828258989122699824531099671571010792842938309497402716166441417132632018588459026783728916362429566991832549143675051463540265249763936481547256254159365503910784575598312171033120536554828196745351470925387540464920329581692944278775276725833279292348253444820865875923354863419611926234144721991323454925340848267729933494169174254815442502261486888373029155222583687471968746178168020956679374611111747153562146747539907486371143402798806941732735439412643410187439554499721373928501351965590654469675704915223278454"
    Public Const OLZ_A2 = "55175803297806790874112957969401161650401027648449188937327721442387613738865893513386252517340748427704081744374133713179155995249311986359905724867437524373952275820789116590239484444976833819324115619206950189947042287589821710115371897875872142528278793345558056202036573452425755420969399834080982517691336911102939553129803037408440726540956451225874459028668928361299876586026507985954417456949409498595361818281154254557844053160515932907757437316524759534687937948206090946516696095729588045563141517345327405776586580417972697319776249581211823922525716677753082715"
    Public Const OLZ_A3 = "89223555352057621366383644218499776384854673648934114277354174437150172789728613085317917307494559331133276629682556019903160597671687625545056284135975158463371365151937961704342337021488445737582204686824146342480545362871255279632643636322121426124685860741524395828838952380251664983124871256606169859398226673983438321738921989687526545156461853655053745299616561532713198293632352359702657579993248176406249491396175868106573784384957541111431996027414764543942717503451392566436548842593851014147626134698451809852662322768403820871540605472123207892292295184136329757"
    Public Const OLZ_B1 = "60545593767543895898172206054275950883625992115732559825649939410484512563342894248886929784995987574957219596708917849957123775314879389356308866927419126847697623198676890164936677446644570906768322723911403645180201081331749495589335645536899055855295365714779693640616826408081104038499824703048226319796109176508677156525282187762155396665797783143936975482496747181378314521997946151588462527256126285469834679025240635399316735973110136281056356420953820805372229574367335521136018411765442289596222580635314296553796227971992274273815921509342267835663156433943722699"
    Public Const OLZ_B2 = "972376468969215130180108181641245474694048843949935626154388761578853918756392191447597

    The Weird and The Wonderful database help question career

  • Another from my boss!
    B Burnsys2

    Another one from my boss! lol. This is actually from a final production software developed by my boss a couple years ago, now we are going to .net and he told me to "Do the same that this module". so here is part of the code:

     tmpAdd = tmpAdd + Format(tmp5, "###,##0") + Chr(9)
                        tmpAdd = tmpAdd + Format(tmp6, "###,##0") + Chr(9)
                        tmpAdd = tmpAdd + Format(tmp3 + tmp5, "###,##0") + Chr(9)
                        tmpAdd = tmpAdd + Format(tmp4 + tmp6, "###,##0") + Chr(9)
                        mTotalesMSF(6) = mTotalesMSF(6) + tmp6 + tmp4
                        If tmp1 = 0 Then
                            tmpCero = 100
                        Else
                            If tmp3 + tmp5 = 0 Then
                                tmpCero = 0
                            Else
                                tmpCero = ((tmp3 + tmp5) / tmp1) \* 100
                            End If
                        End If
                        tmpAdd = tmpAdd + Format(tmp3 + tmp5 - tmp1, "#,##0") + Chr(9)
                        tmpAdd = tmpAdd + Format(tmpCero, "#,##0") + "%" + Chr(9)
                        If tmp2 = 0 Then
                            tmpCero = 100
                        Else
                            If tmp4 + tmp6 = 0 Then
                                tmpCero = 0
                            Else
                                tmpCero = ((tmp4 + tmp6) / tmp2) \* 100
                            End If
                        End If
                        tmpAdd = tmpAdd + Format(tmp4 + tmp6 - tmp2, "#,##0") + Chr(9)
                        tmpAdd = tmpAdd + Format(tmpCero, "#,##0") + "%"
                        mTotalesMSF(7) = mTotalesMSF(7) + tmp4 + tmp6 - tmp2
                        If tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 <> 0 Then msfConsulta.AddItem tmpAdd
                        rstmp.MoveNext
    

    At last, tmp4,6,7,2,3 etc are variables with things like, total sales, proyected sales, pending orders, etc..

    The Weird and The Wonderful database help question career

  • Another from my boss!
    B Burnsys2

    It's ok, the server doesn't exist anymore and the password is encrypted.

    The Weird and The Wonderful database help question career

  • Another from my boss!
    B Burnsys2

    That's exaclly the problem!!! hehe, he actualy force me to work like him! I had lengthy discussions with him for that. Just for example, He keeps using Datatables against collection of custom objects, His reasons: 1: Datatables are fastest and lighter 1: I did a small benchmark code that loaded 10000 Customers to a datatable and to a collection of objects, Collection of objects loaded 3 to 5 times faster and consumed half the memory that datatable So he switch his argument to: 2:Collection of object are not easily bindable! 2:So i created a collection that inherits BindingList, and showed him! So he switched: 3:Collection of object are more insecure, becouse you can make mistakes when you fill them! 3:Customer.Name is always more secure that doing DTCustomers("Name") So in his last chance hi sayd: 4:But collection of objects keeps the memory fragmented, while datatable is loaded in a single continuous block of memory 4:At that point i just say, ok, do whatever you want, you are the boss!! Well, it's always like that. The other day i discused like 1 hour for this: We was working on a project and he has done something like this

    Dim MIObject as object
    Do
    If condition then MiObject = AnotherObject
    Loop
    MiObject.DoSomenthing

    Of course the ide throws a warning becouse "MiObject" could be nothing. So tied of seen that warning, i replaced: Dim MIObject as object by Dim MIObject as object = Nothing So, i spend 2 hour arguing with him, couse he was saying that "= Nothing" loaded the Class in memory and etc... Or for example, i created a Class customer that we can use in every project, i pass the code to him, and when i get it back i see he made a Public Sub in a module like: "ChangeCustomerEmail(CusId as integer, Mail as String)", God Dammit!! for what the hell i did the customer class then? So, this is how i work everyday, i am really tired.

    The Weird and The Wonderful database help question career

  • Another from my boss!
    B Burnsys2

    Don't worry, we are only 2 in the development sector, me and my boss, and obviously he doesn't read The Code Project.com! ;) Anyway, i am really tied of working with someone like this, i see no future here, and i am actually looking for another job.

    The Weird and The Wonderful database help question career

  • Another from my boss!
    B Burnsys2

    This was done to read a file like this (That he designed also):

    1 CONNECT=PROVIDER=SQLOLEDB.1;driver={SQL Server}
    2 server=BGHLOCALES
    3 uid=sa
    4 pwd=408603222608533
    5 database=LCR
    6 Connect timeout=30
    7 CommandTimeout=550

    On Error GoTo h_err_con

    If tIdd = -1 Then
    

    'Conect a SS
    i = 0
    tmp = App.Path + "\Bases.ini"
    If Dir(tmp) = "" Then
    MensajeBOX "Error en configuración. Falta archivo: " & tmp, vbCritical, "Control de entorno"
    Exit Function
    Else
    strConnect = ""
    Open tmp For Input As #1
    Do While Not EOF(1)
    Line Input #1, tmp

                If i = 0 Then
                    tmpPos = InStrRev(tmp, "1 CONNECT")
                    If tmpPos > 0 Then
                        strConnect = Trim(Mid(tmp, tmpPos + 10)) & ";"
                        i = 1
                    End If
                Else
                    If i = 1 Then
                        tmpPos = InStrRev(tmp, "2 server")
                        If tmpPos > 0 Then
                            strConnect = strConnect & Trim(Mid(tmp, tmpPos + 2)) & ";"
                            i = 2
                        End If
                    Else
                        If i = 2 Then
                            tmpPos = InStrRev(tmp, "3 uid")
                            If tmpPos > 0 Then
                                strConnect = strConnect & Trim(Mid(tmp, tmpPos + 2)) & ";"
                                i = 3
                            End If
                        Else
                            If i = 3 Then
                                tmpPos = InStrRev(tmp, "4 pwd")
                                If tmpPos > 0 Then
    

    ' tmpCr = CodificarLI("XVB2S45AF", 1)
    ' tmpCr = DeCodificarLI(tmpCr, 1)
    tmpCr = DeCodificarLI(Trim(Mid(tmp, tmpPos + 6)))
    strConnect = strConnect & "pwd=" & tmpCr & ";"
    i = 4
    End If
    Else
    If i = 4 Then
    tmpPos = InStrRev(tmp, "5 database")
    If tmpPos > 0 Then
    strConnect = strConnect & Trim(Mid(tmp, tmpPos + 2)) & ";"
    i

    The Weird and The Wonderful database help question career

  • Another from my boss!
    B Burnsys2

    no way, this proyect is a gold mine!!! take a look at this, he was afraid of .SetFocus

      sql = "SELECT COD\_GCIA FROM GerenciasWEB WHERE COD\_GCIA = '" & .COD\_GCIA & "'"
        Set rstmp = New ADODB.Recordset
        rstmp.Open sql, db, adOpenForwardOnly, adLockReadOnly
        If rstmp.EOF Or rstmp.BOF Then
            MsgBox "Código de Gerencia: " & .COD\_GCIA & " no es valido", vbCritical, "Elija Otro"
    

    On Error Resume Next
    txtIN(6).SetFocus
    Exit Sub
    Else
    .COD_GCIA = Trim(rstmp.Fields("COD_GCIA"))
    End If

        If tmpCntPermisos = 0 Then
            If MsgBox("Usuario no tiene permisos", vbQuestion + vbYesNo, "¿Desea grabar?") = vbNo Then
    

    On Error Resume Next
    lvPermisos.SetFocus
    Exit Sub
    End If
    End If

        If .TIPO\_USUARIO <> "PROV" And .COD\_GCIA = "" Then
            If MsgBox("Usuario no tiene Gerencia", vbQuestion + vbYesNo, "¿Desea grabar?") = vbNo Then
    

    On Error Resume Next
    txtIN(6).SetFocus
    Exit Sub
    End If
    End If
    'Correo
    If .EMAIL <> "" Then
    If Not checkIngresoEMAIL(.EMAIL) Then
    MsgBox "E-Mail: " & .EMAIL & " no es valido", vbCritical, "Elija Otro"
    On Error Resume Next
    txtIN(5).SetFocus
    Exit Sub
    End If
    End If
    If .COD_RCB_EMAIL = "0" Or .COD_RCB_EMAIL = "" Then

        Else
            If .EMAIL = "" Then
                MsgBox "Debe ingresar E-Mail o cambiar Tipo E-Mail", vbCritical, "Ingrese datos"
    

    On Error Resume Next
    txtIN(5).SetFocus
    Exit Sub
    End If
    End If

    The Weird and The Wonderful database help question career

  • Another from my boss!
    B Burnsys2

    Can you believe this? This function is supposed to be called on the Set Focus event of textboxes in vb6

    Private Sub txtIN_GotFocus(Index As Integer)
    setTxtWnd txtIN(Index)
    End Sub

    Public Sub setTxtWnd(oTxt As TextBox, Optional ByVal tbNoIndex As Boolean = False)
    On Error Resume Next

    With oTxt
        If .Parent.ActiveControl.Name = oTxt.Name Then
            If Not tbNoIndex Then
                If .Parent.ActiveControl.Index = oTxt.Index Then
    

    M_FOC:
    .BorderStyle = 1
    .Appearance = 1
    .SelStart = 0
    .SelLength = Len(.Text)
    Else
    GoTo M_NO_FOC
    End If
    Else
    GoTo M_FOC
    End If
    Else
    M_NO_FOC:
    .BorderStyle = 0
    .Appearance = 0
    End If
    End With
    End Sub

    The Weird and The Wonderful database help question career

  • How to catch a SqlException?
    B Burnsys2

    You mean that when you run that code the msgbox never appears? instead it stops at DbTest.Open with an exception?

    Visual Basic database security tutorial question

  • How to drop builtin\administrators account from sql server
    B Burnsys2

    sp_revokelogin 'BUILTIN\Administrator'

    Database database security question sql-server sysadmin

  • Remote connection to SQL Server
    B Burnsys2

    That looks like a conection problem, First try to ping the server from Dos by it's name, it should at least resolve it's ip address Then from the client machine try this: Start Run CliConfg And then set the "Default network library" to "TCP/IP" If it still not working try Telnet Server 1433 If it says that could not connect, then you have a network problem! -- modified at 12:00 Wednesday 29th August, 2007

    Visual Basic sysadmin help database sql-server security

  • Infrastructure... just because.
    B Burnsys2

    Wow! talking about doing unnecessary extra work! We have to build a software with an sql Database that will have to check for Orders in our ERP DB (Oracle) So, what was my boss idea? He made us create a trigger that each time an order was created or modified a record with it's primary key was added in a table, Then we had an oracle process that run each 10' that looked at that table, recollected all the order information and saved it to another table in oracle, hen he made us install Oracle Gateway so we can access the sql server from oracle, So when there was New orders in the processed table oracle would connect to Sql Server and add a record to a Sql Tabla that said there was new data,Then we had another process in sql server that checked this table every 1' if the table said there was new data then another process was run that read the now processed tables with the order informations in oracle and extracted the data, once it extracted the data the process checked for modification o inserts against the Final Sql Server Orders Table! So after all that we Could access the sql server table from the Software and just list the content of the table.. When i told my boss why don't we just Access the orders table in Oracle from the software he told me: Noooo, if they change their TnsNames.ora file it would stop working!!! :wtf:

    The Weird and The Wonderful csharp database design sysadmin business

  • Remote connection to SQL Server
    B Burnsys2

    You are not specifying the security options. For NT Authentication: "provider=sqloledb;Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=SSPI;" For Sql Authentication: "provider=sqloledb;Data Source=SERVER;Initial Catalog=DATABASE;UID=SA;PWD=Pass"

    Visual Basic sysadmin help database sql-server security

  • (VB6.0)validating a textbox for MM/dd/yyyy format
    B Burnsys2

    You should not use "SendKeys "{home}+{end}" If you want to select the textbox content try this: Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text)

    Visual Basic help tutorial

  • My boss! [modified]
    B Burnsys2

    I just remember another one!!!!! Public Class Order Public Sub New (CmbClient as Combobox, dtpOrder as DatePicker, etc. etc.) End Sub End Class That's what i call OOP!

    The Weird and The Wonderful

  • My boss! [modified]
    B Burnsys2

    lol, i just hope my boss could visit this site and learn a little!

    The Weird and The Wonderful

  • My boss! [modified]
    B Burnsys2

    If Var1= True then M_1: Do some stuff Else DO other Stuff Goto M_1 end if ----------------- If Var1=True then Goto M2 'Some Code. Goto M3 M2: 'Other Code Exit sub M3: 'Code ------------------ Class Order 'Some Definitions and code End Class Module1 Public Sub SaveOrder (order as Order) Code to save the Order End sub End module -------------------------- You have no idea what it's to work with someone like that!!! the worst thing..... He is my boss!!!!!! -- modified at 23:36 Saturday 18th August, 2007

    The Weird and The Wonderful

  • this is what iwant to do
    B Burnsys2

    i have a dedicated table "Emails" with columns: "From","To","Subject","Text" The table has trigger on insert that calls a xp_sendmail Any time i need to send an email fron anywhere all i have to do is insert a record in that table!

    Database database tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups