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: 414
Default DAO Recordset in Excel

I'm trying to populate a recordset using a query in Excel VB code as below :-

Dim db As Database
Dim rs1 As Recordset
Dim SQLstr As String
Dim OrigCP As Variant

OrigCP = "AB123"

db = "c:\my.mdb"

SQLstr = "SELECT History.Field2, History.OrigCP FROM History WHERE
History.OrigCP=" & OrigCP
Set rs1 = db.OpenRecordset(SQLstr)

I get an error 3061 (Too few Parameters - Expected 1).

Any ideas? - I've done this lots directly in Access VB OK.

Thanks.

 
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
adodb.recordset with excel nate axtell Excel Programming 14 June 11th 04 01:32 PM
Type recordset/recordset? FlaviusFlav[_9_] Excel Programming 4 May 24th 04 12:16 PM
Recordset in Excel Newbie Excel Programming 3 February 12th 04 12:34 PM
Display a Recordset in Excel Alex A Excel Programming 5 October 31st 03 10:13 PM
Recordset Opening Excel File Seth[_3_] Excel Programming 0 August 1st 03 01:52 PM


All times are GMT +1. The time now is 11:15 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"