+ Reply to Thread
Results 1 to 5 of 5

recordset "WHERE" failing

  1. #1
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    328

    recordset "WHERE" failing

    I am pulling information from a CSV into a recordset
    I can read the csv fine to run an "open for append" sub.
    Please Login or Register  to view this content.
    however the second function intended to fill an array of matching parts for a revision userform is failing (Runtime error 80040e10) no value for required parameters on the recordset.open line.
    Please Login or Register  to view this content.
    The locals is pulling the query through fine
    Source "SELECT * FROM TestFile.csv WHERE PartNo = ACTEST" Variant/String
    Unfortunately because the process is passed to ACE, VBA isn't able to give much information on what is wrong.
    Last edited by Leon V (AW); 10-14-2022 at 02:24 AM.
    Sub Reputation()
    Dim Problem as Variant
    Dim Reputation as Integer
    For Each Problem in Forum.Threads
        If Problem.Title = "*[Solved]*" and Solver.Name = "Leon V (AW)" Then Reputation = Reputation + 1
    Next Problem
    End Sub

  2. #2
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: recordset "WHERE" failing

    Hi.
    It seems to me that the value sought is a string.
    In such a case, that value must be enclosed in single quotes.

  3. #3
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    328

    Re: recordset "WHERE" failing

    If that were the issue surely it would just return an empty set rathere than throwing out a runtime error?
    Added in the single quotes and the error changes to 80040e07 though...

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,337

    Re: recordset "WHERE" failing

    try change
    1)
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    2) Add one line before Select statement
    Please Login or Register  to view this content.
    see how it goes...

  5. #5
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    328

    Re: recordset "WHERE" failing

    needed to '' the header name too

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. VBA DB recordset returns other language characters as "?" and " -> "
    By deepa1028 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2013, 06:20 AM
  4. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  5. "Set Range" failing. Maybe I just need to take a break from it
    By wonderputz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2012, 03:52 PM
  6. Creating a FUNCTION that "looksup" data from an EXTERNAL workbook...I'm failing, HELP!
    By insaneoctane in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-29-2012, 05:22 PM
  7. "acessor flags" creating pivot table from recordset
    By Wolfie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2006, 04:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1