POST, Analise dan Share Code di sini - VBers - Page 4
Welcome guest, is this your first visit? Create Account now to join.
  • Login:

Welcome to the CHIP Forum.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

+ Reply to Thread
Page 4 of 51 FirstFirst 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ... LastLast
Results 31 to 40 of 506

Thread: POST, Analise dan Share Code di sini - VBers
  
Bookmark and Share

  1. #31
    Join Date
    Jan 2005
    Location
    Jakarta
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Question Re: POST, Analise dan Share Code di sini - VBers



    bantuin aku dong...

    kasih tau dong source codenya untuk mencari SN/ID dari PC yaitu:
    - Hardisk
    - NIC
    - MacAddress
    - Processor

    makasih ya..., lam kenal...

  2. #32
    Join Date
    Jan 2005
    Posts
    908
    Thanks
    0
    Thanked 9 Times in 8 Posts
    Rep Power
    21

    Re: POST, Analise dan Share Code di sini - VBers



    @4903NK :
    akan lebih menyenangkan bila ada spesifikasi utk jenis OS-nya ?
    btw, welcome 4903NK
    i'll try to make one for what u askin.

    Regard, Positive+
    " A man's felicity consists not in the outward and visible blessing of fortune, but in the inward and unseen perfections and riches of the mind "

    thomas carlyle

    where i used to go when surfing :
    site1 site2 site3 ...


  3. #33
    Join Date
    Jan 2005
    Posts
    908
    Thanks
    0
    Thanked 9 Times in 8 Posts
    Rep Power
    21

    Re: POST, Analise dan Share Code di sini - VBers



    Variables Declaration

    Note : Just for noobs / beginners

    Download *.zip file archieve below

    Positive+,
    Attached Files

  4. #34
    Join Date
    Jan 2005
    Posts
    908
    Thanks
    0
    Thanked 9 Times in 8 Posts
    Rep Power
    21

    Re: POST, Analise dan Share Code di sini - VBers



    @4903NK :
    OK, this is it ( i've goto other computer first, this computer don't have VB )
    this what i made ( code tested on W2000 Prof / W32 bit)

    Code:
    Option Explicit
    
    '/ I give good code - Positive+
    Const NL = vbNewLine
    Dim temp As String
    Dim Obj As Object
    
    Function GetMac() As String
        temp = ""
        '// winmgmts:Win32_NetworkAdapterConfiguration=""0""" <-- 0 adl Index, gunakan looping bila perlu
        Set Obj = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=""0""")
        temp = IIf(Not IsNull(Obj.MacAddress), _
                   "MAC Address Is : " & CStr(Obj.MacAddress), "Ngga dapet") & NL
        temp = temp & "Description Is : " & CStr(Trim(Obj.Description)) & NL
        temp = IIf(Not IsNull(Obj.IPAddress), _
                   temp & "IP is : " & CStr(Obj.IPAddress(0)), "") & NL
        '// Obj.IPAddress(0) <-- yup, kita ambil MAC pada index list 0 aja. kembali lagi it's up to you :D
        temp = IIf(Obj.DHCPEnabled = 1, temp & "DHCP is On", temp & "DHCP is Off")
        GetMac = temp '/ return
        Set Obj = Nothing '/ release memory usage
    End Function
    Function Hardisk() As String
    Dim oDrv As Object
         temp = ""
         Set Obj = GetObject("winmgmts:").InstancesOf("Win32_DiskDrive")
         
         For Each oDrv In Obj
             temp = temp & "Hardisk Is : " & IIf(Not (oDrv.Caption) = "", oDrv.Caption & NL, "Ngga dapet")
         Next
         Hardisk = temp
         Set oDrv = Nothing '/ release memory usage
         Set Obj = Nothing '/ release memory usage
    End Function
    Function GetProcSerial() As String
    Dim oProc As Object
        temp = ""
        Set Obj = GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem")
        '// back again, mengapa pake looping ? kemungkinan utk lebih dr 1 proc ttp ada
        For Each oProc In Obj
            temp = temp & "Processor Serial is : " & IIf(Not IsNull(oProc.SerialNumber), CStr(oProc.SerialNumber), "Ngga dapet lagi") & NL
        Next
        GetProcSerial = temp
        Set oProc = Nothing '/ release memory usage
        Set Obj = Nothing '/ release memory usage
    End Function
    Private Sub Command1_Click()
        temp = GetMac() & NL & NL & GetProcSerial() & NL & Hardisk()
        MsgBox temp
    End Sub
    walaupun bs menggunakan API ( that's too long to code it ) jd saya hanya
    menggunakan apa yg bisa saya buat dlm waktu singkat saja.
    Tambahkan jg utk cek OSVersion user km. Code di atas hanya mengambil semua informasi dr service windows yg sedang berjalan. ( Thought, that's da easy way and short to get what we want it ).
    semoga berguna, have fun with it

    ( Ma'af saya br bs balas skrg. Ma internet access s**k right now )
    Positive+,
    Last edited by positive+; 25-12-2005 at 18:49.

  5. #35
    Join Date
    Jan 2005
    Posts
    908
    Thanks
    0
    Thanked 9 Times in 8 Posts
    Rep Power
    21

    Re: POST, Analise dan Share Code di sini - VBers



    To all :

    Tolong, bila kamu menggunakan code2 yg saya berikan :

    Bila terdapat bugs / kamu menemukan beberapa kesalahan pada code yg saya berikan. Post di sini mengenai bugs description-nya.

    Bila code yg berhubungan dengan System, sertakan juga untuk jenis OS yg
    kamu gunakan. ( seperti System API code, Services, etc )

    Bila code yg berhubungan dengan database, sertakan juga nama database, OS ( ServicePack ,etc ) dan bugs description-nya.

    Selebihnya saya akan mencantumkan pada OS mana code has been tested.
    saya akan sangat ber-terima kasih sekali untuk itu

    Best Regard to All VBers, Positive+
    Last edited by positive+; 28-12-2005 at 21:18.

  6. #36
    Join Date
    Jan 2005
    Posts
    908
    Thanks
    0
    Thanked 9 Times in 8 Posts
    Rep Power
    21

    Re: POST, Analise dan Share Code di sini - VBers



    Counting Words In a File

    I have been questioned by other forum member, about How to counting word in a file, here is ma answered .. thought, might be u need one about that

    Code:
    '// ========================//========================
    '// counting words in file - Positive+ Samples
    '// ========================//========================
    Private Sub Command1_Click()
    Dim temp As String, marr() As String
    Dim i As Long
        ' default value string is vbnullstring
        temp = ""
        ' open file with binaries methode - much faster than Ascii methode
        ' you can change da file path to yours - course
        Open "C:\data.txt" For Binary As #1
             temp = Space(Fix(LOF(1)))
             Get #1, , temp
        Close #1
        ' now, replace all string that we define not as a word to space or vbnullstring
        temp = Replace(Replace(Replace(Replace(temp, vbNewLine, " "), ",", ""), ".", ""), "/", " ")
        ' put all word in dynamic array var, split by space
        marr() = Split(temp, " "): temp = ""
        ' now, loop to get it listed
        For i = LBound(marr()) To UBound(marr())
            temp = temp & marr(i) & vbNewLine
        Next
        ' show msg list of word
        MsgBox temp, 0, "List of words"
        ' counting word result
        MsgBox UBound(marr()) + 1, 0, "Word Count"
        ' erase array as empty
        Erase marr()
    End Sub
    '// ========================//========================
        'have fun coding ::.
    '// ========================//========================

  7. #37
    Join Date
    Jan 2005
    Posts
    908
    Thanks
    0
    Thanked 9 Times in 8 Posts
    Rep Power
    21

    Re: POST, Analise dan Share Code di sini - VBers



    Short Explanation For VB Noobs knowledge - Positive+
    ================================================== ==
    Out Of Memory bugs of VB ::.
    ================================================== ==
    Yeah, ini salah satu bug dari VB yg tidak akan pernah diperbaiki oleh microsoft
    " Out Of Memory ". hingga menjadi salah satu dilema bagi programmer VB
    hal ini bukan disebabkan oleh karena memory computer kita yg terpakai habis oleh VB
    hingga ngga da space lagi utk action lainnya ( nob, that's totally wrong )
    " Out Of Memory " ini disebabkan karena VB membuat buffer memory sendiri untuk
    semua kebutuhannya, mulai dari object, penempatan variable ,etc.
    So, what will happen if we run out of that space ? akan muncul pesan yg sangat mengesalkan " out of memory " dan akan terlihat seperti semua code2 kita jadi ngga berguna, object2 yg terlihat freeze, etc. ( Restart computer will fix it )
    Dan lebih parahnya lagi, this memory space digunakan oleh setiap applikasi VB ( IDE )
    so, bila kita akan membuka Instance baru dari IDE VB, all clipboard usage, etc will be clean up with no compromise first.
    jadi, apa yg bisa kita lakukan utk itu ... Hhhh, live with it ... but, dimana ada kekurangan
    disitu juga pasti ada kelebihan keep ur smile
    ================================================== ==
    What is Option Explicit ::.
    ================================================== ==
    Option Explicit -- Singkatnya variables must be declared / setiap variable yg akan digunakan harus dideklarasikan terlebih dahulu.

    Apa keuntungan dari penggunaan ini ? Program kamu akan lebih cepat, aman dan bersih
    yup, banyak keuntungan hanya dari sebaris kata " Option Explicit "
    dengan menggunakan Option Explicit, VB akan melakukan swap terlebih dahulu dari semua variable yg digunakan, menyesuaikan dan menyiapkan variable utk data yg akan diterima, space dari memory yg akan digunakan oleh setiap type variable, etc.
    Contoh dari deklarasi variable :
    '// Yup, menggunakan Option explicit - but, declarasi dari variable tidak ditentukan typenya ??
    Option Explicit
    Sub Test()
    '// Pembuatan variable spt ini, VB akan secara automatic menempatkan-nya sbg Variant
    '// dimana type dr variable akan ditentukan dengan data / value yg dipegang oleh var itu nantinya
    Dim A
    A = "Positive+" '// Yup, disini VB akan menetapkan bahwa type dr var ini adl String sesuai dgn data yg dipegang oleh var tsb - declarasi spt ini cukup lambat dan kotor
    End Sub
    Sub Test()
    '* Hhh, deklarasi variable spt ini yg bener2 tidak terkontrol dan kotor - no Option Explicit
    '* Not recommended to use like this
    A = "Positive+"
    End Sub
    '// Yup, this is the correct variable declaration and the correct way to begin code
    Option Explicit '// always use this ... ALWAYS !!!
    Sub Test()
    Dim A As String
    A = "Positive+"
    End Sub
    OK then, i just have a short time to access da internet and ma seat at da office has been waiting 4 me. Semoga penjelasan singkat utk para beginner VB ini dapat menjadi pegangan dan pandangan dlm melakukan programming with VB.
    I'll write more later Keep da spirit alive and burn that keyboard on
    ( If there's a question or some to discuss .. add here )

    Fight till the end of ur live, Positive+

  8. #38
    Join Date
    Oct 2005
    Location
    Jakarta
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: POST, Analise dan Share Code di sini - VBers



    Yth,
    Rekan-rekan milis

    saya sedang ada masalah, mohon pencerahannya!
    begini saya sedang membuat sebuah database yang didalamnya ada 3 tabel (2 tabel entitas, dan 1 tabel transaksi)
    tabel 1 mempunyai atribut : -id1 (key)
    jns_mat
    tabel 2 mempunyai atribut : -id2 (key)
    Supplier
    tabel 3 mempunyai atribut : -id3 (key)
    qty
    permasalahannya:

    - bagaimana ER-nya apabila key pada tabel 3 adalah gabungan dari key tabel 1 dan 2,
    contoh: key tabel 1 (id1) : MA
    key tabel 2 (id2) : 02
    key tabel 3 (id3) : id1+ id2 = MA02
    - bagaimana codenya pada program nanti apabila kita akan melakukan query maka kita cukup memasukkan id3 saja dan program mengerti bahwa yg dimaksud adalah barang dengan jenis tertentu yg diambil dari tabel 1 dan dari suplier tertentu yg ada di tabel 2.
    -dan jga coding yg efektif untuk melakukan proses edit, update n erasenya bagaimana?

    atas bantuannya saya ucapkan terimakasih.
    Dedi Dermawan Putra

    = IT Support =

    Information Technology Department

    PT. PolymatechIndonesia, Mfg.

    Industrial Town MM2100Block O/9

    Cikarang Barat -Bekasi

    Telp. +62 218980170 / 71

    Fax. +62 21 8981314

    Email. dewaputra_82@yahoo.com

  9. #39
    Join Date
    Jan 2005
    Posts
    908
    Thanks
    0
    Thanked 9 Times in 8 Posts
    Rep Power
    21

    Re: POST, Analise dan Share Code di sini - VBers



    @Dewaputra, what database ???
    ================
    1. tabel 1 mempunyai atribut : -id1 (key) -> MA
    [ jns_mat ]
    2. tabel 2 mempunyai atribut : -id2 (key) -> 02
    [ Supplier ]
    3. tabel 3 mempunyai atribut : -id3 (key) -> MA02
    [ qty ]
    =================
    ER [ jns_mat ] <> [ qty ] and [ Supplier ] <> [ qty ]
    to linked ( Relation ) between one table to other - must have same data type and values instead ! ( consider to re-construct )
    [ if not with relationship chase it by records ]

    - bagaimana codenya pada program nanti apabila kita akan melakukan query maka kita cukup memasukkan id3 saja
    use MID() or else instead

    -dan jga coding yg efektif untuk melakukan proses edit, update n erasenya bagaimana?
    Code:
    Option Explicit
    
    '** put on modules **
    
    Enum ma_action
         Added = 0
         Updated = 1
         Deleted = 2
    End Enum
    
    Private Type brg '** bring this anywhere u want < add, update, del >
         id     As String
         nm_brg As String
         etc    As String
    End With
    
    Private Type supplier '** bring this anywhere u want < add, update, del >
         id     As String
         nm     As String
         phone  As String
         etced  As String
    End With
    
    Public ma_stuff As brg
    ' or Public ma_stuff() As brg <- dynamic array -> browse -> searching
    ' ma_stuff < values > put on object u desired
    Public ma_supp As supplier
    ' or Public ma_supp() As supplier <- dynamic array -> browse -> searching
    ' ma_supp < values > put on object u desired
    
    Sub do_actions(iAct As ma_action, Tbl As String, Optional sId As String = "")
        'SQL sample = "select * from [" & tbl & "] where --> condition --> use [ sId ] params
        'check iAct for which Tbl instead
        'do ur actions here
        Exit Sub
    End Sub
    
    '** positive+ ** good day and happy coding
    [ note ]
    For searching [ use array to make ur app more faster % LIKE % too heavy ]
    Selecting [ use array too  ( * ) this asterix heavy enought 
    
    efective or not ... that's relative
    hope that help, Positive+
    Last edited by positive+; 17-01-2006 at 22:18.

  10. #40
    Join Date
    Oct 2005
    Location
    Jakarta
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Talking Re: POST, Analise dan Share Code di sini - VBers



    4 positive+

    databasenya adalah database material, dalam db itu ada 3 tabel:

    tabel1 mempunyai 2 atribut :
    - id1 sebagai key
    - jns_mat

    tabel2 mempunyai 2 atribut :
    - id2 sebagai key
    - suplier

    tabel3 mempunyai 2 atribut :
    - id3 sebagai key
    - Qty

    nah saya mau membuat id3 adalah gabungan dari id1 n id2 jadi satu material dapat ditentukan jenis dan supliernya berdasarkan id3 saja contoh:

    pada tabel 1 :
    id1 = MA
    jns_mat = silicon ruber

    pada tabel 2 :
    id2 = 02
    suplier = tanashin

    pada tabel 3 :
    id3 = MA02 (gabungan id1 dan id2)
    qty = 1000 kg

    nah pada saat di program, user cukup menginput id3 saja, maka program akan langsung menampilkan jns_mat, suplier, n qty.

    klo soal coding mungkin apa yg anda buat sudah cukup bagus, tetapi yg menjadi masalah adalah bagaimana menghubungkan id1, id2 dan id3 secara ERD-nya

    bagaimana apakah anda dapat memberikan pencerahan dari masalah ini?


 

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

     

Bookmarks

Posting Permissions

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