LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Syntax of VBA Code

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax problem with code WLMPilot Excel Discussion (Misc queries) 1 March 15th 08 07:07 PM
Syntax of this code ExcelMonkey Excel Programming 1 July 21st 05 11:29 AM
syntax for code in MsgBox()? Ouka[_4_] Excel Programming 2 July 20th 05 05:18 PM
VBA code to sum a row: syntax needed [email protected] Excel Discussion (Misc queries) 1 July 11th 05 06:41 PM
help with code/syntax Jay Baxter Excel Programming 0 February 26th 04 08:11 PM


All times are GMT +1. The time now is 11:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"