OBJEK OLEDB CONNECTION is the object used many for application client-server.
We can exploit this object to handle the problem koneksi with :
- SQL SERVER
- MICROSOFT ACCESS
- ORACLE
MEMBER OBJEK OLEDBCONNECTION :
- Properties
- Connection String
- Connection TimeOut
- Database
- Provider
- Server Version
- State
- Method
- ChangeDatabase
- Close
- CreateCommand
- GetOleDbSchemaTable
- Open
Way to Use :
- Require library object from :
imports system.data.oledb
- Syntaks declaration :
Dim con ace new oledbconnection
- Inisialisasi value :
Connect to Ms. Access
Con.connectionstring = “ provider = Microsoft.Jet.Oledb.4.0; data source = filename”
Connect to SQLServer
Con.connectionstring = “ provider = SQLOLEDB; data source = nama_server;user id = user_SQLServer;password = password_user; initial catalog = Nama_Database; connect timeout = nilai_timeout”
- Connect to Database
con.open()
- Cover Koneksi
con.close()
Example [of] :
Imports System.Data.oledb Module Module1
Sub Main ()
Dim strcon Ace String Dim con Ace New OleDbConnection
strcon == " provider = Microsoft.Jet.Oledb.4.0; data source = Z:\Db withVB.NET\Contoh Latihan\Access DB\LatihanDB.mdb;"
con.ConnectionString = strcon con.Open()
Console.Writeline(Con.Connectionstring)
Console.Readline()
con.Close()
End Sub
End Module
No comments:
Post a Comment