Re: FTS Weighted Values Implementation Problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have been making it too hard (as usual).

Instead of trying to cast from double or decimal to string (or vice
versa), I should have just started out with whole numbers between 0-9
as string data and concatenated into decimal string data. I thought
the SELECT statement required double or decimal data. String is just
fine all the way.

Dim Weight1 As String
Weight1 = ("." + WeightTextBox1.Text)

Dim Weight2 As String
Weight2 = ("." + WeightTextBox2.Text)

Dim Weight3 As String
Weight3 = ("." + WeightTextBox3.Text)

Dim adp As New SqlDataAdapter("SELECT FT_TBL.FullDocNo,
FT_TBL.DocType, KEY_TBL.RANK FROM FullDocuments AS FT_TBL INNER JOIN
CONTAINSTABLE(FullDocuments, SectionText, 'ISABOUT (""" + SearchTerm1
+ """ weight (""" + Weight1 + """), """ + SearchTerm2 + """ weight
(""" + Weight1 + """), """ + SearchTerm2 + """ weight (""" + Weight3 +
""") )' ) AS KEY_TBL ON FT_TBL.FullDocumentID = KEY_TBL.[KEY] ORDER BY
KEY_TBL.RANK DESC ", conn)

Thanks for sticking with me till resolution.

Best wishes,

Dave

On Sep 5, 3:39 pm, "Jean-Pierre Riehl" <jean-pierre.ri...@b-e-w-i-s-
e.fr> wrote:
Hi,

Message="Syntax error near 'RealWeight1.ToString' in the full-text

You wrote RealWeight1.ToString() as a literal string instead of a
concatenation of values.
Don't miss the parenthesis indicating to use ToString method on double
object.

You shoud use String.Format routine to prepare your Full-Text query, it
would be clearer in your mind. See MSDN documentation for examples.


.



Relevant Pages

  • Re: New to VBA, not to programming - Extracting Characters from a String?
    ... replace by repeated concatenation of a string that is repeatedly increasing ... which testbeds some VB5 code I wrote many years ago when I was first getting ... string data to a byte array ...
    (microsoft.public.vb.general.discussion)
  • Re: syntax...
    ... B&D on the part of the language designer. ... probably handle concatenation of string literals by itself, ... bitwise XOR, or if not that, then exponentiation.) ...
    (comp.lang.misc)
  • Bugs in the Module::Dependency
    ... Manifying blib/man1/pmd_indexer.plx.1 ... Use of uninitialized value in concatenation or string at ... # Failed test in t/04grapher.t at line 81. ...
    (perl.dbi.users)
  • RE: Simple regex problem has me baffled
    ... I am writing a script to analyse a log file. ... Each pair of Request and Response calls have a unique ... Use of uninitialized value in concatenation or string at ...
    (perl.beginners)
  • Re: Literal concatenation, strings vs. numbers (was: Numeric literals in other than base 10 - wa
    ... Well my take on it is that this would not be the same as string ... concatenation, the series of digits would be parsed as a single token ... digit separation can superficially resemble string concatenation if ... I would favor _ as a digit separator in Python ...
    (comp.lang.python)