Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can I use variable in this function? #1

Open
jrnreg opened this issue Dec 14, 2015 · 5 comments
Open

how can I use variable in this function? #1

jrnreg opened this issue Dec 14, 2015 · 5 comments

Comments

@jrnreg
Copy link

jrnreg commented Dec 14, 2015

hi, VxE,thank you for your function.
how can I use variable in this function?

Gui, Add, Edit, x66 y47 w140 h30 vEdit1 gChange, type here
Change:
Gui, Submit,NoHide
msgbox,% ADOSQL( connection_string ";coldelim= `t", "
(
SELECT name, number
FROM phonenumber.csv
WHERE ab LIKE '%'+%edit1%+'%'
)")

it doesn't work,can you help me?

@Jim-VxE
Copy link
Owner

Jim-VxE commented Dec 14, 2015

Hi, jrnreg. AHK has two very different ways of using variables; they don't mix, as it looks like you're trying to do. Try preparing your strings before passing them to a function, that way, you can use a msgbox to verify the value being passed to the function. E.g:

query =
(
SELECT name, number
FROM phonenumber.csv
WHERE ab LIKE '%%edit1%%'
)
MsgBox %query% ; verify
result := ADOSQL( connection_string ";coldelim= `t", query )
MsgBox %result%

@jrnreg
Copy link
Author

jrnreg commented Dec 16, 2015

It's work!!!
thank you very very very much!!!!VxE!! thank you!!! you helped me a lot!

@jrnreg
Copy link
Author

jrnreg commented Dec 24, 2015

Hi,VxE,I can't use "*" in query,
can you help me?

connection_string :=
("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=.\Database1.mdb")

query =
(
SELECT name, number
FROM phonenumber
WHERE ab LIKE "*WL*";
)

MsgBox %query% ; verify

result := ADOSQL( connection_string ";coldelim= `t", query )
msgbox %result%
return

@keiiz
Copy link

keiiz commented Jan 9, 2016

jrnreg ' rather than " in your LIKE?

@jrnreg
Copy link
Author

jrnreg commented Jan 14, 2016

WHERE ab LIKE '%WL%' work.thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants