koneksi vb 6 k mssql 2000


coba kk buat 1 function yang isinya

Function getConnectionString() As String
getConnectionString = “Provider=SQLOLEDB.1;Password=pass01;” & _
“Persist Security Info=True;User ID=sa;Initial Catalog=….nama databasenya….;” & _
“Data Source=192.168.0.1”
End Function

nanti pas mau connectnya coba pake function dibawah ini sebagai contoh :

private sub combobox1_change()
dim nwdb as odbc connecting, dim nwrs as odbc recordset

newdb.ConnectionTimeout = 0
newdb.ConnectionString = getConnectionString
newdb.Open

with nwrs
.open “select * from test1”,newdb
if not.bof and not.eof then
combbox2.caption=!noid
end if
end with

newdb.close
end sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: