/* */

Friday, November 19, 2010

[belajar-access] MS Acess dengan Database Mysql ???

Teman2 milis ada yang punya file access dengan BE Mysql? kalo ada dishare dong....
saya nyoba tapi bingung, buatnya tabelnya gimana? pake link kayak BE nya access atau pakai script koneksi seperti ini? (dari arsip milis dahulu kalau ga salah adm_surat_new)
Trus kalau pake script, memanggilnya kapan?saat buka file atau mau pakai tabel?
Terima Kasih atas responnya.

Option Compare Database
Option Explicit
Public conn As New ADODB.Connection
Public Function connToDB(serverName As String, _
UserName As String, userPass As String, _
dbPath As String, dbName As String)
Dim strCon As String
On Error GoTo errHandle
strCon = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=" _
& serverName & ";DATABASE=" & dbName & ";" & _
"UID=" & UserName & ";PWD=" & userPass & ";OPTION=16426"

Set conn = New ADODB.Connection
conn.Open strCon
Exit Function
errHandle:
MsgBox "SERVER SEDANG TIDAK AKTIF", , "NON AKTIF"
conn.Close
Set conn = Nothing
End Function

Function KONEKSI()
' modikasi ini, dengan keadaan yang sesuai
' contoh connToDB "localhost", "username", "password", port, "nama database"
connToDB "localhost", "root", "root", 3306, "SURAT"
End Function


------------------------------------

SPAM IS PROHIBITEDYahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/belajar-access/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/belajar-access/join
(Yahoo! ID required)

<*> To change settings via email:
belajar-access-digest@yahoogroups.com
belajar-access-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
belajar-access-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

No comments:

Post a Comment