myID dan myPassword hanya "bohongan" agar tidak di salah gunakan oleh orang2 pinter yang sering nge-hack. Dan itu hanya deklarasi Koneksi ke DB. Cara Remarknya tambahkan saja tanda petik tunggal di awal statement.
Asli : On Error Resume Next Menjadi 'On Error Resume Next --- rima <[EMAIL PROTECTED]> wrote: > DEAR GUNAWAN, > > Gimana caranya aku mau meremark statement, aku > kurang paham neh > maksudnya...tolong dong lebih simpel karena aku > masih pemula neh... > > > trus myid and my pasword itu jalan secara otomatis > atau itu hanya deklarasi > dimana my id and my pasword sudah didefenisikan > dahulu, karena di sql server > aku banyak pake user dan semua paswordnya beda > sesuai tingkatannya... > > tolong lebih jelas mas, sorry klo terlalu banyak > tanya neh.... > > > thank's > > rio > ----- Original Message ----- > From: "Gunawan doang" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Wednesday, August 10, 2005 1:23 PM > Subject: Re: [Programmer-VB] TANYA UPDATE RECORD > > > > bila di compile pake Mata dan oleh system pun bila > di > > jalankan juga tidak error, karena error traping > > diambil aleh oleh On Error Resume next, Coba anda > > remark statement tersebut kemudian jalankan > kembali, > > error nya muncul apa ? > > > > Saran : > > 1. sebaiknya instruksi "jangan di gunakan" > > 2. .ConnectionString = "provider=sqloledb;user > > id=EMC;password=rers123;persist security > info=true; > > > > Connection string di atas sebaiknya jangan > full-gar > > seperti ini, untu mengurangi hal2 "jahil". karena > ada > > informasi Data Source, initial catalog, uid, dan > pwd. > > > > sebaiknya anda edit menjadi > > .ConnectionString = "provider=sqloledb;user > > id=myID;password=mypassword;persist security > > info=true; > > > > > > TK > > --- rima <[EMAIL PROTECTED]> wrote: > > > > > ini contoh programnya: > > > > > > > > > Dim ECON As ADODB.Connection > > > Dim RS1 As ADODB.Recordset > > > ============================================ > > > 'ini maslahnya > > > 'pas aku add data pertama masuk tapi pas aku add > > > lagi gak masuk datanya > > > Private Sub Command1_Click() 'ini tombol add > > > If Len(Trim(Text1.Text)) < 5 Or > > > Len(Trim(Text1.Text)) > 5 Then > > > MsgBox ("ID tidak boleh <5 ATAU >5") > > > Text1.SetFocus > > > Text1.Text = " " > > > Exit Sub > > > End If > > > > > > > > > If Text2.Text = " " Then > > > MsgBox ("diisi...") > > > Text2.SetFocus > > > Exit Sub > > > End If > > > > > > > > > If Len(Trim(Text1.Text)) = 5 And Text2.Text <> > " " > > > Then > > > ok > > > > > > > > > If RS1.RecordCount > 0 Then > > > MsgBox ("Data Sudah Ada") > > > Text1.SetFocus > > > Exit Sub > > > End If > > > On Error Resume Next > > > RS1.AddNew > > > RS1.Fields("CD_BRG") = Text1.Text > > > RS1.Fields("NM_BRG") = Text2.Text > > > RS1.Update > > > End If > > > > > > > > > BLANK 'ini fungsi kosongkan > > > > > > > > > > > > > > > > > > > > > End Sub > > > > > > ============================================= > > > 'ini fungsinya > > > > > > Private Sub BLANK() > > > Text1.Text = " " > > > Text2.Text = " " > > > Text1.SetFocus > > > > > > End Sub > > > > =================================================== > > > Private Sub Form_Load() > > > > > > Set ECON = New ADODB.Connection > > > With ECON > > > .ConnectionString = "provider=sqloledb;user > > > id=EMC;password=rers123;persist security > info=true; > > > initial catalog=tester;data source=rio-csumum" > > > .Open > > > If Not .State = adStateOpen Then > > > MsgBox "Tidak dapat membuat hubungan > ke > > > database" > > > End If > > > End With > > > > > > End Sub > > > ============================================= > > > 'ini fungsi buka recordsetnya > > > Private Sub ok() > > > Dim sql As String > > > Set RS1 = New ADODB.Recordset > > > > > > > > > sql = "select * from jns_brg where cd_brg='" & > > > Trim(Text1.Text) & "'" > > > With RS1 > > > .ActiveConnection = ECON > > > .CursorLocation = adUseClient > > > .CursorType = adOpenDynamic > > > .LockType = adLockOptimistic > > > .Source = sql > > > .Open > > > End With > > > > > > > > > End Sub > > > ----- Original Message ----- > > > From: Tatu Inderawan > > > To: [email protected] > > > Sent: Wednesday, August 10, 2005 12:12 PM > > > Subject: RE: [Programmer-VB] TANYA UPDATE > RECORD > > > > > > > > > sory neh, aku kurang nangkep maksudnya, kirim > aja > > > codingnya sekalian error msg-nya ya? > > > takutnya codenya sudah benar tp logikanya yg > > > salah... OK... > > > > > > sekedar gambaran : > > > > > > Private Sub cmd_AddSave() > > > > > > fungsi_simpan > > > fungsi_kosongkan_teks > > > > > > End Sub > > > > > > dan pastikan koneksi database & record sudah > di > > > open sebelumnya... > > > > > > -----Original Message----- > > > From: [email protected] > > > [mailto:[EMAIL PROTECTED] Behalf > Of > > > rima > > > Sent: 10 Agustus 2005 11:43 > > > To: [email protected] > > > Subject: Re: [Programmer-VB] TANYA UPDATE > RECORD > > > Importance: High > > > > > > > > > input pertama masuk tapi pas yang > keduakalinya > === message truncated === ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hjqjgqt/M=362329.6886308.7839368.1510227/D=groups/S=1705115364:TM/Y=YAHOO/EXP=1123663287/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 ">Fair play? Video games influencing politics. Click and talk back!</a>.</font> --------------------------------------------------------------------~-> Untuk keluar dari millis ini, kirim email kosong ke: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/Programmer-VB/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
