Unanswered: Run time error 3709 connection cannot be......
I am trying to connect to DB2 with a connection string but it is giving me an error, the connection cannot be used to perform this operation: please help because i have double checked and i cant find anything wrong with it: it gives me the error on the line in bold
Public Sub LoopQueries()
Dim i As Long
Dim MFcnn As New ADODB.Connection
Set MFcnn = New ADODB.Connection
.Provider = "IBMDADB2.DB2COPY2"
.Mode = adReadWrite
.ConnectionString = "Password=" & password & ";Persist Security Info=True;User ID=" & username & ";Data Source=" & DatabaseEnv & ";Mode=ReadWrite;"
Dim rsMFcnn As ADODB.Recordset
Set rsMFcnn = New ADODB.Recordset
Dim SQL As String
SQL = Sheet1.Range("AE2")
.Open SQLSheet1.Range("AC2").CopyFromRecordset rsMFcnn
Set rsMFcnn = Nothing
Set cnMFcnn = Nothing
For j = 1 To 2
If (Sheet1.Cells(i, 1) = "") Then
j = 2
j = 1
i = i + 1