Results 1 to 7 of 7
  1. #1
    Chad Access is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2015
    Posts
    49

    Access Linked to SQL Server - Using Not Equals

    I have the following:



    Click image for larger version. 

Name:	Forum2.jpg 
Views:	8 
Size:	56.6 KB 
ID:	35184

    I want to make notes <> "Some Expression"

    However, writing the traditional way, the ODBC connection fails. If I run it the way it is in the picture, it runs just fine.

    Any ideas for me?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What is the exact criteria and error you got? I just tested against a linked SQL Server table and it worked as expected.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is Notes a memo field in Access? I rarely use, and wonder if that causes a problem. I'll try to find one and test it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Chad Access is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2015
    Posts
    49
    Yes, it is a memo field.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Also worked as expected against a memo field.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Chad Access is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2015
    Posts
    49
    "The data types ntext and varchar are incompatible in the equal to operator". The field is ntext in the sql table. Then I am just comparing it to a text string by saying <> "Text String"


    UPDATE: I changed the field on the SQL Server side to varchar(max) and it works properly now. Hooray!

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Haven't run into this one, but I don't use ntext. Some thoughts from a quick search:

    https://blog.sqlauthority.com/2012/1...l-to-operator/
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 02-05-2018, 12:34 PM
  2. Access SQL Linked Server from DSN
    By AME in forum SQL Server
    Replies: 5
    Last Post: 07-26-2016, 09:31 AM
  3. Replies: 4
    Last Post: 12-23-2015, 07:45 AM
  4. Replies: 12
    Last Post: 11-26-2013, 03:37 PM
  5. Replies: 3
    Last Post: 05-17-2012, 05:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums