Spot my error
Posted
#1
(In Topic #923)
Enthusiast

I hope someone can spot my error as I can not and this is driving me nuts
Code
$Query &= "Select "
$Query &= "function, "
$Query &= "linenumber, "
$Query &= "lineaglinment, "
$Query &= "linefont, "
$Query &= "Replace(linetext, ",, ", ", ") As Linetext "
$Query &= "from rec_table "
$Query &= "Where function='" & RecipitMode & "' order by linenumber ASC;"The above SQL code works on Windows VB.net but I can not seem to get it to work correct on Gambas could someone Please point out where i have gone wrong (as I have been working on this all day)
Thank-you
Posted
Guru

$Query &= "Replace(linetext, ",, ", ", ") As Linetext "
the Replace is a vb command not a sql one
maybe…
$Query &= Replace(linetext, ",, ", ", ")
(just a guess, it's something like that)
Posted
Guru

BruceSteers said
i do not know SQL but this line is wrong…
$Query &= "Replace(linetext, ",, ", ", ") As Linetext "
the Replace is a vb command not a sql one
maybe…
$Query &= Replace(linetext, ",, ", ", ")
(just a guess, it's something like that)
i could be wrong and it is sql command in which case …
$Query &= "Replace(linetext, ",, ", ", ") As Linetext "
(backslash the quotes)
Like i say i do not know sql but understanding what that line is supposed to do and doing it the gambas way is the key to fixing the problem.
Posted
Enthusiast

Posted
Enthusiast

Posted
Enthusiast

Code (gambas)
- "\"" & sVariableName & "\""
this is the same this :
Code (gambas)
When building a string to query a SQL file and a little eraser to write
Posted
Enthusiast

Posted
Regular

It takes a bit of getting used to but in the end it makes building sql statements quite easy.
b
Posted
Enthusiast

1 guest and 0 members have just viewed this.


