Solved

SQL Access Query from ado.net

Posted on 2012-04-02
1
347 Views
Last Modified: 2012-08-14
Greetings,

My SQL query does not return any results.  I am using ADO.NET from VB.Net 2008.  
There are three variables:

BankID,   Word1, and    Word2

The query is:

Sql = "Select QID from Keywords WHERE ((BankID = " &  BankID & ") And  (Keyword Like '" & Word1 & "?' ))  & " and QID  IN " &
(Select QID from Keywords WHERE ((BankID = " & BankID & ") And  (Keyword Like '" & Word2 & "?' )))"



I have used both a  ? and an * for the wildcards.    I do not get an error, but the dataset is empty.


Thanks for any help

VW
0
Comment
Question by:VWhitehead
1 Comment
 
LVL 18

Accepted Solution

by:
lludden earned 500 total points
Comment Utility
wildard in SQL is %
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now