0

Here's my SQL Statement:

SELECT * FROM tblHeader WHERE Requestor='"&label1.text&"'

Why doesn't it work?

3
Contributors
10
Replies
11
Views
7 Years
Discussion Span
Last Post by Alphard
0

Here's my SQL Statement:

SELECT * FROM tblHeader WHERE Requestor='"&label1.text&"'

Why doesn't it work?

Hi Alphard,

may be becuase of last comma issue...
SELECT * FROM tblHeader WHERE Requestor='" & label1.text & "'"

Edited by Piya27: n/a

0

Hi Alphard,

may be becuase of last comma issue...
SELECT * FROM tblHeader WHERE Requestor='" & label1.text & "'"

I did that but it doesn't seem to work..

0

then please post the exact error. so that we can find out where the problem lies.

0

then please post the exact error. so that we can find out where the problem lies.

Hi Piya!

Here's the error:
Invalid text or symbol.
Error in WHERE clause near'"
Unable to parse query text.

0

Post your code. Use following syntax if column type is non-numeric,

str="SELECT * FROM tblHeader WHERE Requestor='" &  Text1.Text & "'"

For numeric type,

str="SELECT * FROM tblHeader WHERE Requestor=" &  Text1.Text
0

Post your code. Use following syntax if column type is non-numeric,

str="SELECT * FROM tblHeader WHERE Requestor='" &  Text1.Text & "'"

For numeric type,

str="SELECT * FROM tblHeader WHERE Requestor=" &  Text1.Text

I'm doing it through Query Builder is it possible to that there?

0

no it is not possible there you have to specify the exact string or text instead of Label1.Text.

0

Piya: no it is not possible there you have to specify the exact string or text instead of Label1.Text.

Why not? There is no problem with Label's Text with value.

0

Hello Sir,

I am not saying that there's any problem with Label's Text with value
I wrote this because Alphard is using Query Builder which I don't think takes values from Label or TextBox.(I may be wrong, but I have suggested what I have practised). I use Query Builder for testing my queries and that never takes values from Labels etc.

0

no it is not possible there you have to specify the exact string or text instead of Label1.Text.

Thanks Piya! Its already working...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.