[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL like query problem

Posted on 2005-05-08
5
Medium Priority
?
296 Views
Last Modified: 2010-04-07
I have the following SQL query:
SELECT tblDelegate.DelegateTitle, tblDelegate.DelegateName, tblDelegate.DelegateAffiliation FROM tblDelegate WHERE (((tblDelegate.DelegateName) Like '*e?'))

The problem is, that it doesn't generate any results even though the actual Access db query generates 19 results.

This is the form for it:

<% If ((Request.QueryString("delegate") = "lettere")) %>

    <form runat="server">
      <asp:DataList id="lettere" runat="server" width="80%">

        <ItemTemplate>
          <center><h3><%#Container.DataItem("DelegateName")%></h3></center>
          <b>Title:</b><%#Container.DataItem("DelegateTitle")%>
          <b>Affiliation:</b><%#Container.DataItem("DelegateAffiliation")%>
          <br><br><br>
        </ItemTemplate>

      </asp:DataList>
    </form>

Has anyone got any ideas?

This question follows on as the second part of the question on this page:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21415986.html
It is the second of two problem I have had with the database.

Thanks in advance.
0
Comment
Question by:DanBAtkinson
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
laotzi2000 earned 2000 total points
ID: 13954740
Try change
Like '*e?'
To
Like '%e_'
0
 

Author Comment

by:DanBAtkinson
ID: 13954796
Sorry, that's mySQL syntax and it doesn't work in an Access database which is what mine is.
0
 

Author Comment

by:DanBAtkinson
ID: 13954812
Ok. Today is being a very weird day...

So... The query syntax '*e?' works in Access but '%e_' doesn't work because Access does not recognise % and _ as correct syntax.

I have actually tried that method further down the page:
http://www.webthang.co.uk/tuts/tuts_dbase/sql_raed2/r_sql_2.asp

...in access as a query but it didn't recognise % or _. Never mind, it works. Only that I didn't think it would!!!

Points awarded to laotzi2000 and I deserve a slap around the head for thinking that Access knew best! :p
0
 
LVL 12

Expert Comment

by:laotzi2000
ID: 13954887
in fact that's ado wildcard: % and _
if you run the query in access, you should use * and ?
but with ado, you should use % and _
0
 

Author Comment

by:DanBAtkinson
ID: 13954904
Ok. Thanks! Yes. ADO! I meant ADO really! ;) I've just spent an hour in a seminar about it!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Screencast - Getting to Know the Pipeline
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question