koneksi database

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

koneksi database

fahrian
gan gimana caranya mengkoneksikan vb 6 ke sql server 2005 ?
Reply | Threaded
Open this post in threaded view
|

Re: koneksi database

djiesoft
Dim ConStr As String
ConStr = "Provider=SQLNCLI.1;User ID=sa;Password=123;Initial Catalog=DATABASE_TEST;Data Source=192.168.254.200\SQL2005"

Dim con As New ADODB.Connection
con.Open ConStr

atau jika tidak tahu instance name nya bisa pake ip address saja (tanpa \sql2005) karena instance name berbeda2 tergantung saat instalasi.

trus jika konkesi ke sql server 2008 tinggal ganti provider-nya menjadi SQLNCLI10.1