M
marsulein
Oooppssss, my bad. Missed out that line.
Code:
--------------------
Dim strName As String
Dim strPosition as String
Dim objExcel As Object
Set objExcel = CreateObject("ADODB.Recordset")
Dim rsData as ADODB.RecordSet
Set rsData = New ADODB.RecordSet
--------------------
After I have opened the connection of the spreadsheet, all the data are
stored in objExcel.
After I have opened the connection to my database, all the data are
stored in rsData which then will be used as filter.
Code:
--------------------
objExcel.MoveFirst
Do While Not objExcel.EOF
strPosition = objExcel.Fields("Position").Value
rsData.Filter = "Position = ' " & strPosition & " ' "
If Not rsData.EOF Then
strName = objExcel.Fields("Name").Value
End If
objExcel.MoveNext
Loop
Code:
--------------------
Dim strName As String
Dim strPosition as String
Dim objExcel As Object
Set objExcel = CreateObject("ADODB.Recordset")
Dim rsData as ADODB.RecordSet
Set rsData = New ADODB.RecordSet
--------------------
After I have opened the connection of the spreadsheet, all the data are
stored in objExcel.
After I have opened the connection to my database, all the data are
stored in rsData which then will be used as filter.
Code:
--------------------
objExcel.MoveFirst
Do While Not objExcel.EOF
strPosition = objExcel.Fields("Position").Value
rsData.Filter = "Position = ' " & strPosition & " ' "
If Not rsData.EOF Then
strName = objExcel.Fields("Name").Value
End If
objExcel.MoveNext
Loop