'From Internet 

Dim objConn as ADODB.Connection
Dim objRS as ADODB.Recordset
Dim strConn as String
Dim strSQL as String
Set objConn = New ADODB.Connection
Set objRS = New ADODB.Recordset

'Create a connection string.
strConn = "Provider=SQLOLEDB;Data Source=MyServer;" & _
     "Initial Catalog=Northwind;User Id=MyId;Password=123aBc;"

'You can find OLEDB providers and connection syntax for all kinds of 
'other data sources including text files.

'The following string is equivalent to the first used for access to
'SQL Server:
strConn = "Provider=SQLOLEDB;Server=MyServer;" & _
     "Database=Northwind;User Id=MyId;Password=123aBc;"

objConn.Open strConn 'will open the database connection.

'An alternate way to open the connection is:
With objConn
    .ConnectionString = strConn
    .ConnectionTimeout = 120
    .CommandTimeout = 120
    .Open
End With

'The ability to change connection properties is
'a major reason to explicitly create a Connection object.

'This can also be done without the connection string as:
With objConn
    .Provider = "SQLOLEDB"
    .DefaultDatabase = "Northwind"
    .Properties("Data Source") = "MyServer"

    .Properties("User Id") = "MyId"
    .Properties("Password") = "123aBc"
    .Open
End With

'Lets create the simplest possible SQL we want to execute.
strSQL = "Select * from tbAddresses "

'You can now open the recordset.
With objRS
    .Open strSQL, objConn
End With

'or
objRS.Open strSQL, objConn

'or without using the connection object
objRS.Open strSQL, strConn, adOpenForwardOnly

'See documentation on ADO to understand the cursor type options 
'(such as adOpenForwardOnly).
'You can now use the data in objRS.
'=====
'Be sure you close and destroy your objects.
objRS.Close
objConn.Close
Set objConn = Nothing
Set objRS = Nothing


----- Original Message ----- 
From: "Abdurrahman Suryadi" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, November 24, 2008 01:15
Subject: [belajar-access] Password SQL SERVER dari Form Access


> Assalamu'alaikum Wr. Wb.
> 
> Teman-teman, bagaimana caranya mengintegrasikan password yang kita buat 
> sendiri di form dengan link ODBC yang kita arahkan ke SQL Server? 
> Sehingga kita tidak melihat lagi login asli dari ODBC itu.
> Note: Tidak memakai trusted connection.
> 
> Syukron atas jawabannya
> 
> Wassalamu'alaikum Wr. Wb.
> 
> 
> 

Kirim email ke