+ Reply to Thread
Results 1 to 4 of 4

SQL search argument that contains blank value causes error

  1. #1
    Forum Contributor
    Join Date
    04-05-2011
    Location
    behind you!
    MS-Off Ver
    Excel 2010
    Posts
    116

    SQL search argument that contains blank value causes error

    Hi,

    I send this SQL statement to a ms-access database:

    Please Login or Register  to view this content.
    This causes an error: Run-time error '-2147217900(80040e14)': Automation error


    Strategies(i, 1) looks like this "abc xyz"

    I know that the statement is interpreted like this: SELECT Keyword from Setup where ID=abc xyz order by Keyword

    What is necessary to tell acces that abc xyz is one word?

    Thank you very much!
    Lloyd

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: SQL search argument that contains blank value causes error

    Please Login or Register  to view this content.
    It's generally not good practice to have variable length strings as primary keys though

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: SQL search argument that contains blank value causes error

    Normally ID is used as a Unique ID autonumber. If you have a field that is ID and is a text field you need to add a single quotes before and after Strategies(i, 1)

    try this

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Forum Contributor
    Join Date
    04-05-2011
    Location
    behind you!
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: SQL search argument that contains blank value causes error

    Hi Kyle,

    thanks for the fast reply. Yes you are right, I have done the according changes in the database design.

    Lloyd

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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