Skip to content
View in the app

A better way to browse. Learn more.

Komuniti @PuTeRA

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VB 2008 with Microsoft Access 2007 ADD DELETE EDIT & SELECT tutorial

Featured Replies

salam & hi kepada suma geng putera,
kat sini aku ada satu function nak kongsi ngan korg,
manetau ada org yg nak pakai benda ni,
kegunaan function ni adala utk execute query(INSERT,DEL,UPDATE dan bukan SELECT akan diberitahu) ke MS ACCESS 2007 ACCDB database.

aku biasa buat function ni dalam class lain (global class) yang akan digunakan dalam semua form aku yang lain.

dibawah ialah function nya.
[code]<dl class="codebox"><dt>Code:</dt><dd><code>Public Function query2(ByVal sql) As String
    Public Function query2(ByVal sql) As String ' parameter dinamakan sebagai sql
        cmd = New OleDb.OleDbCommand(sql, con) 'command oleDB di declare pada variable cmd
        con.ConnectionString = "PROVIDER=Microsoft.ACE.OLEDB.12.0;Data Source=clinic.accdb" ' connection setting untuk driver ms access 2007 file accdb. sila tukar 'clinic.accdb' kepada nama file db anda
        MsgBox(sql) ' diguna untuk pemeriksaan syntax sql
        con.Open() ' koneksi di aktifkan
        maxRows = cmd.ExecuteNonQuery ' command di laksanakan
        If maxRows = 1 Then ' dibawah diguna untuk pemeriksaan query
            MsgBox("data successfully quried")
        Else
            MsgBox("Failed to query record")
        End If
        con.Close()
        Return Nothing
    End Function</code></dd></dl>

cara menggunakannya ialah spt berikut:

<dl class="codebox"><dt>Code:</dt><dd><code>sql = "DELETE from illness_history where ID='" &amp; txtIllnessID.Text &amp; "'"
query2(sql)</code></dd></dl>[/code]

amacam sapa dah cuba ?

klo ada reply aku akan teruskan thread ni.. hehe

Edited by LanoG
menambah code tag untuk memudahkan membaca code.

  • 3 months later...
bro, contoh add, delete, edit, update yg gune database .mdf yg ada dlm vb express 2008 xder ker?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.