_LIKE_ doesn't work in SQL-Statement

.net , vb6 United States
  • 18 years ago

    I'm using the german verrsion of VB6. Curious: the Compiler and eventhe SQL-Designer cannot handle a statement like this: "SELECT ... FROM ... WHERE <field> LIKE 'A'" that's working fine with i.e. MS Access or any other SQL-Query. It's seems to me that the placeholder '' ist not corectly interpreted. But what should I do then?

  • 18 years ago

    try using a % instead of *


  • 18 years ago

    thanx alot, Teft! that solves my problem (I found the answer a little earlier on the web, but anyway ...)

  • 18 years ago

    but, Teft, another question about SQL, this time in conjunction with VB Studio .NET (hope, you are familiar to that?). THE SQL-Designer there (by the way: it's working WITH the * as placeholder :-0) produces an error when I try to join three (or more) tables with the INNER JOIN Statement (tbl1 INNER JOIN tbl2 ON ... tbl2 INNER JOIN ON ... etc.). There is always an Expression missing, says the Box,  (BUT it works fine with only TWO conjuncted tables). Of course, the produced SQL Statement is again a working Term in MS Access. Do they really know what they are doing at the MS Programming Team???

  • 18 years ago

    To "inner join" more than two tables use this syntax:

    Select <fields>
    
    FROM
    TableN INNER JOIN (
    ....(
    Table3 INNER JOIN (
    Table1 INNER JOIN  Table2 ON Table1.field=Table2.field)
    ON Table3.field=<table1 or table2>.field)
    ...


    See?  First joing two tables, then join the result with the next table, and so on.

  • 18 years ago

    okay! I did it, but the designer is changing it into HIS syntax and than ... it's wrong again. seems to be an fatal error of the designer, isn't it? That is, because the designer develops the JOIN-Statements by the joined tables on Top and one cannot change the syntax. I'm afraid, I have to do it inside the code ... but thanx anyway

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“You can stand on the shoulders of giants OR a big enough pile of dwarfs, works either way.”