02-09-2010, 05:22 PM
Hi,
Try this out
Try this out
Code:
objConxn.Errors.Clear
With objConxn
If .State = adStateClosed Then
.Provider = "sqloledb"
.Properties("Data Source").Value = DB_Server
.Properties("Initial Catalog").Value = DB_Name
If Len(Trim(DB_UserName)) = 0 And Len(Trim(DB_Password)) = 0 Then
.Properties("Integrated Security").Value = "SSPI"
Else
.Properties("User Id") = DB_UserName
.Properties("Password") = DB_Password
End If
.CommandTimeout = 0
.Open
End If
End With