galih_persadha galih_persadha...,
Ada beberapa model koneksi database yang tersimpan di webhost.
1. Memakai PHP ==> Ms Acces-XML
2. Memakai IP (akses data biasanya agak berat).
Untuk yang IP, tergantung jenis databasenya. Masing-masing memiliki karakteristik tidak sama. Dibawah ini, salah satu contohnya.
Option Explicit
Public conn As ADODB.Connection
Public Enum TIPE_DATABASE
FIREBIRD = 1
MYSQL = 2
SQLSERVER = 3
End Enum
Public Function connToDB(ByVal tipeDb As TIPE_DATABASE, _
Optional ByVal serverName As String = "", _
Optional ByVal userName As String = "", _
Optional ByVal userPass As String = "", _
Optional ByVal dbPath As String = "", _
Optional ByVal dbName As String = "") As Boolean
Dim strCon As String
On Error GoTo errHandle
Select Case tipeDb
Case FIREBIRD
strCon = "DRIVER=Firebird/Interbase(r) Driver;UID=" _
& userName & ";PWD=" & userPass & ";" & _
"DBNAME=" & serverName & ":" & dbPath & "\" & dbName _
& ""
Case MYSQL
strCon = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=" & serverName _
& ";DATABASE=" & dbName & ";" & _
"UID=" & userName & ";PWD=" & userPass & ";OPTION=3"
Case SQLSERVER
strCon = "Provider=SQLOLEDB.1;User ID=" _
& userName & ";Pwd=" & userPass & ";" & _
"Initial Catalog=" & dbName & ";Data Source=" & serverName & ""
End Select
Set conn = New ADODB.Connection
conn.ConnectionString = strCon
conn.Open
connToDB = True
Exit Function
errHandle:
connToDB = False
End Function
Semoga bisa membantu dan memberi semangat.
Hariyanto (Surabaya)
--------------------------------------------
On Fri, 30/5/14, galih_persadha galih_persadha@yahoo.co.id [belajar-access] <belajar-access@yahoogroups.com> wrote:
Subject: [belajar-access] Koneksi ms access ke database web host
To: belajar-access@yahoogroups.com
Date: Friday, 30 May, 2014, 7:14 AM
Kepada para suhu ms access.
Mohon bantuannya bagaimana cara koneksi ms access ke
database jika database saya ada di webhost.
Posted by: hari yanto <har_i20002000@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar