Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 2nd, 2006, 02:57 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Automation error..maybe missing parameter?

Could you all look for a problem in this ADO? TIA

Public Sub PlainTextQuery()

    Dim rsData As ADODB.Recordset
    Dim szConnect As String
    Dim szSQL As String

    szConnect = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
                "Data Source=C:\Test\Calls.mdb; "

    szSQL = "SELECT Date, Skillset, Calls " & _
            "FROM Calls " & _
            "ORDER BY Date"

    Set rsData = New ADODB.Recordset
    rsData.Open szSQL, szConnect, adOpenForwardOnly, adLockReadOnly, adCmdText

    If Not rsData.EOF Then
        Sheet1.Range("A2").CopyFromRecordset rsData
        rsData.Close
        With Sheet1.Range("A1:C1")
            .Value = Array("Date", "Skillset", "Calls")
            .Font.Bold = True
        End With
        Sheet1.UsedRange.EntireColumn.AutoFit
    Else
        MsgBox "Error: No Records Returned.", vbCritical
    End If

    If CBool(rsData.State And adStateOpen) Then rsData.Close
    Set rsData = Nothing

End Sub

Gives Run-time error '-2147217904(80040e10)

This is almost identical to one in the VBA books. Thanks.

Reply With Quote
  #2 (permalink)  
Old March 3rd, 2006, 09:38 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is fixed...thx Bob

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automation Error nagarajan123 Access 0 April 30th, 2008 09:22 AM
Missing Parameter Field Current Value vk18 Crystal Reports 2 December 26th, 2007 10:01 AM
Missing parameter in Jet OLEDB connection OldCoder ASP.NET 1.0 and 1.1 Professional 2 April 21st, 2006 11:29 PM
Automation error..maybe missing parameter? kalebson Access VBA 4 March 3rd, 2006 11:48 AM
error 7866 when using automation pilmart Access 0 August 29th, 2003 02:57 PM



All times are GMT -4. The time now is 01:49 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.