K
KayZee
Hello,
I am trying to build this application where I will be using wildcards, but I
am coming to a dead end when I try to modify the code that I found on the
Help and Support page
(http://support.microsoft.com/default.aspx?scid=kb;EN-US;826992). The error
message that I am getting is that whatever I type into the field I want to do
a wildcard search in, I get a message that says the typed word is an INVALID
COLUMN. I don't even think it should recognize it as a column. Does anyone
have an idea what is going on? Here are some parts of the code without
getting too deep into it...
// Get the default SQL command for the form.
var strOrigSQLCommand = XDocument.QueryAdapter.Command;
// Get the query node that you want to modify.
var querytbl_____ = XDocument.DOM.selectSingleNode(
"/dfs:myFields/dfs:queryFields/q:tbl_______");
var strTitle = querytbl_______.selectSingleNode("@___Title").text;
querytbl______.selectSingleNode("@____Title").text = "";
.......
if (strTitle != "")
{
if (strMySQLCommand != "")
strMySQLCommand = strMySQLCommand + " AND ";
strMySQLCommand = strMySQLCommand +
"([tbl______].[________Title] LIKE \"" + strTitle + "\")";
}
// Construct the full query string.
var strSQLQuery = strOrigSQLCommand;
if (strMySQLCommand != "")
strSQLQuery = strSQLQuery + " WHERE " + strMySQLCommand;
// This is the query.
XDocument.UI.Alert(strSQLQuery);
// Run the query.
XDocument.QueryAdapter.Command = strSQLQuery;
XDocument.Query();
Thanks for all your help
I am trying to build this application where I will be using wildcards, but I
am coming to a dead end when I try to modify the code that I found on the
Help and Support page
(http://support.microsoft.com/default.aspx?scid=kb;EN-US;826992). The error
message that I am getting is that whatever I type into the field I want to do
a wildcard search in, I get a message that says the typed word is an INVALID
COLUMN. I don't even think it should recognize it as a column. Does anyone
have an idea what is going on? Here are some parts of the code without
getting too deep into it...
// Get the default SQL command for the form.
var strOrigSQLCommand = XDocument.QueryAdapter.Command;
// Get the query node that you want to modify.
var querytbl_____ = XDocument.DOM.selectSingleNode(
"/dfs:myFields/dfs:queryFields/q:tbl_______");
var strTitle = querytbl_______.selectSingleNode("@___Title").text;
querytbl______.selectSingleNode("@____Title").text = "";
.......
if (strTitle != "")
{
if (strMySQLCommand != "")
strMySQLCommand = strMySQLCommand + " AND ";
strMySQLCommand = strMySQLCommand +
"([tbl______].[________Title] LIKE \"" + strTitle + "\")";
}
// Construct the full query string.
var strSQLQuery = strOrigSQLCommand;
if (strMySQLCommand != "")
strSQLQuery = strSQLQuery + " WHERE " + strMySQLCommand;
// This is the query.
XDocument.UI.Alert(strSQLQuery);
// Run the query.
XDocument.QueryAdapter.Command = strSQLQuery;
XDocument.Query();
Thanks for all your help