Salut,
voici pour toi un code qui te permettra de répondre à ton problème :

Dim sServerName, sUsername, sPasswd as string
On Error GoTo ErrorHandler
Set objsqlserv = New SQLDMO.SQLServer
objsqlserv .LoginTimeout = -1 '-1 is the ODBC default (60) seconds
'Connect to the Server
If chkAuthentication Then
With objsqlserv
'Use NT Authentication
.LoginSecure = True
'Do not reconnect automatically
.AutoReConnect = False
'Now connect
.Connect txtServer.Text
End With
Else
With objsqlserv
'Use SQL Server Authentication
.LoginSecure = False
'Do not reconnect automatically
.AutoReConnect = False
'Use SQL Security
.Connect sServerName, sUsername, sPasswd
End With
End If
'Set global sqlserver value
Set goSQLServer = objsqlserv
'Show next form
frmSQLScript.Show
Me.Hide
Exit Sub
ErrorHandler:
MsgBox "Error: " & Err.Number & " " & Err.Description, vbOKOnly, "Login Error"
Toufixm!