Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

tolongin master VB : cara menyimpan tabel notepad ke mysql

salam kenal senior2, master2 program
mohon bantuan, maklum newbie

saya punya data tabel dlm bentuk notepad (*.txt) seperti ini

Address      * Time (sec)    * Dx  * Hx  * Mx  * Sx
471C80     * 74058                * 00 * 20 * 34 * 018
471CA0     * 74382                * 00 * 20 * 39 * 042
471CC0     * 74706                * 00 * 20 * 45 * 06

bagaimana caranya supaya dpt dsimpan baris perbaris ke mysql

mohon bantuannya senior2 :)

makasih

Comments

  • ini code yg sudah saya buat >>>

    #################################################
    Private Sub cmdGET_Click()

    Dim Data
    Dim Address, SystemTime, D, H, M, S As String
    Dim Counter, SWReg, MainBus, Current As String
    Dim TempPCU, TempPCDH, TempBatt, TempMP, ZPlus, ZMinus As String
    Dim XPlus, XMinus, YMinus, SBand As String

    'Get a free file number#
    nFileNum = FreeFile

    'Open a text file for input. inputbox returns the path to read the file#
    Open "D:\data20120101.txt" For Input As nFileNum
    lLineCount = 1

    'Read the contents of the file#
    Do While Not EOF(nFileNum)
    Line Input #nFileNum, sNextLine

    'do something with it, add line numbers to it, in this case!#
    sNextLine = sNextLine & vbCrLf
    sText = sText & sNextLine

    Data = Split(sNextLine, "*")
    Address = Data(0)
    SystemTime = Data(1)
    D = Data(2)
    H = Data(3)
    M = Data(4)
    S = Data(5)
    Counter = Data(6)
    SWReg = Data(7)
    MainBus = Data(8)
    Current = Data(9)
    TempPCU = Data(10)
    TempPCDH = Data(11)
    TempBatt = Data(12)
    TempMP = Data(13)
    ZPlus = Data(14)
    ZMinus = Data(15)
    XPlus = Data(16)
    XMinus = Data(17)
    YMinus = Data(18)
    SBand = Data(19)

    Set Record = Conn.Execute( _
    "Insert
    into tbl_longtelemetry
    (tele_address,tele_system_time,tele_day,tele_hour,tele_minute,tele_second,tele_cmdcounter,tele_swreg,
    tele_mainbusvoltage,tele_current,tele_temppcu,tele_temppcdh,tele_tempbatt,tele_tempmp,tele_tempzplus,
    tele_tempzminus,tele_tempxplus,tele_tempxminus,tele_tempyminus,tele_tempsband)" & _
    "values('" & Data(0) & _
    "', '" & Data(1) & _
    "', '" & Data(2) & _
    "', '" & Data(3) & _
    "', '" & Data(4) & _
    "', '" & Data(5) & _
    "', '" & Data(6) & _
    "', '" & Data(7) & _
    "', '" & Data(8) & _
    "', '" & Data(9) & _
    "', '" & Data(10) & _
    "', '" & Data(11) & _
    "', '" & Data(12) & _
    "', '" & Data(13) & _
    "', '" & Data(14) & _
    "', '" & Data(15) & _
    "', '" & Data(16) & _
    "', '" & Data(17) & _
    "', '" & Data(18) & _
    "', '" & Data(19) & "')")

    Loop
    Text1.Text = sNextLine
    'Text1.Text = sText

    'Close the file
    Close nFileNum

    End Sub
    ########################################

    tapi waktu di save ke mysql yg ke save cuma baris pertama saja, baris selanjutnya tidak ke save

    Address * Time (sec) * Dx * Hx * Mx * Sx
    471C80 * 74058 * 00 * 20 * 34 * 018
    471CA0 * 74382 * 00 * 20 * 39 * 042
    471CC0 * 74706 * 00 * 20 * 45 * 06

    BAGAIMANA SUPAYA BARIS SELANJUTNYA IKUT KE SAVE
    mohon pencerahannya... :)










Sign In or Register to comment.