Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the macro excerpt below I am trying to test for the condition in which
four fields of a text file (Fund, CC, BOC and ACC) are concatenated together and compared to a variable field (LookUp). I can not get the correct syntax in the rsInput.Open statement. Can someone tell me the correct syntax, please? TIA. For ILoop = 2 To NumRowsIC LookUp = Sheets(2).Cells(ILoop, "F") Set oConn = New ADODB.Connection Set rsInput = New ADODB.Recordset oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & strPath & ";" & _ "Extended Properties=""text;HDR=NO;FMT=FixedLength""" rsInput.Open "SELECT * FROM " & FileOpenNameVista & " where Fund & CC & BOC & ACC = " LookUp, oConn, adOpenStatic, adLockOptimistic, adCmdText ActiveSheet.Cells(1, 1).CopyFromRecordset rsInput rsInput.Close Next ILoop -- Ken Hudson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Syntax problem with code | Excel Discussion (Misc queries) | |||
Syntax of this code | Excel Programming | |||
syntax for code in MsgBox()? | Excel Programming | |||
VBA code to sum a row: syntax needed | Excel Discussion (Misc queries) | |||
help with code/syntax | Excel Programming |