Access to SQL problems.

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Re: Access to SQL problems.

    You're using & ... concatenation is handled with + in SQL Server.



    "Matt Smith" <_matt@breathemail.net> wrote in message
    news:bf0vr4$a77$1@sparta.btinternet.com...
    > In putting my app on line I'm trying to upgrade my database to MS SQL
    > Server.
    > My host has converted my data to SQL (after much effort God bless 'em) but
    > I'm having a spot of bother with one particular query (which some of you
    may
    > have spotted Aaron Bertrand helping me with last week).
    >
    > My statement is as follows:
    > "SELECT ProductData.DacNumber, "& _ "ProductData.ProdName & ' ' &
    > ProductData.SuppliersCatalogueNumber AS ProdName, ProductData.ProdPrice,
    > tblSubCatList.strSubCategory
    > FROM ProductData
    > LEFT JOIN tblSubCatList ON ProductData.SubCategory=tblSubCatList.iSubCatID
    > WHERE (((ProductData.SupplierIndex)=" & i_SupplierIndex & "))
    > ORDER BY ProductData.SubCategory, ProductData.ProdName;"
    >
    > In my Access version the fields definitions are:
    > ProductData.
    > DacNumber: Long Integer, Primary Key
    > ProdName: Text (100)
    > SuppliersCatalogueNumber: Text (26)
    > ProdPrice: Currency
    > SubCategory: Long Integer
    > SupplierIndex: Long Integer
    >
    > tblSubCatList.
    > iSubCatID: Long Integer, Primary Key
    > strSubCategory: Text(35)
    > SupplierIndex: Long Integer
    >
    > The field SupplierIndex in both instances refers to table
    > SupplierList
    > SupplierIndex: Long Integer Primary Key
    >
    > As to what these fields became in SQL, I do not know, but can reasonably
    (i
    > hope) assume that Text would become nvarchar and Long Integer would become
    > int (at the very least).
    >
    > The error is this:
    > Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    > [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid operator for data
    > type. Operator equals boolean AND, type equals nvarchar.
    >
    > /newlook/browse/products.asp, line 42
    >
    > Line 42 being the ADODB.Connection.Execute call with the earlier shown SQL
    > statement.
    >
    > ASP FAQ 3.0 suggests:
    >
    > #2195 What are the limitations of Access?
    >
    > #2080 What are reserved Access, ODBC and T-SQL keywords?
    >
    > #2086 Why do I get 'Syntax Error in INSERT INTO Statement' with Access?
    >
    > #2400 Why do I get 80040E14 errors?
    >
    > #2061 Why do I get 'Argument data type text is invalid for argument
    [...]'?
    >
    > #2394 Can I use the NZ() function without getting 80040E14 errors?
    >
    >
    > but none of these appear to relate to my error.
    >
    > Anyone got any suggestions?
    >
    > Cheers
    >
    > Matt
    >
    >
    >

    Aaron Bertrand - MVP Guest

  2. Similar Questions and Discussions

    1. Having Problems With SQL Statement[ACCESS DB]
      Hi, This is my SQL Procedure : IFF(21 in(SELECT PageID FROM TBL_Trafic WHERE PageID=21), (UPDATE TBL_Trafic SET Hits=Hits+1,...
    2. Problems with Access Db
      Thanks for your reply. Its nearly a gig so I guess that doesn't help. The db is on the same server as my intranet.
    3. problems access an MS Access 2000 DB using ASP
      Our graphic designer is developing our new company website. We have switched providers and currently she is working on the new website which...
    4. Access connections problems
      I get the following error when trying connect to an Access db on the local drive. Error Type: Provider (0x80004005) Unspecified error...
    5. Array access problems
      The below is my code and i would like to access the last element of the array maer_array. The MAER_FILE looks like the following...
  3. #2

    Default Re: Access to SQL problems.

    "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
    news:OgiRZhtSDHA.2152@TK2MSFTNGP12.phx.gbl...
    > You're using & ... concatenation is handled with + in SQL Server.
    >
    Changing to use '+' has led to blank field returns where there is no
    ProductData.SuppliersCatalogueNumber.
    What am I missing?

    I used to use '+' for concatenation but found that I couldn't combine text
    with numeric fields 'cos Access tried to add them up. Not good. Is this
    likely to happen with SQL Server too?

    Matt


    Matt Smith Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139