Question Locked

vb qury

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i connected access database with vb
now from a combo box i am taking the string in a variable wk
now i want to open the access table with sql query on the basis of wk

i want to know the syntex
i am not able to complete the systex
i.e.
select * from aa where aa!weekt=wk

this is not working
what to do

2 replies

by tony hopkinson

is in access, vb is expecting SQL

mycommand.commandtext = "Select * From a Where weekt = " & wk

or similar is what you want, presuming wk is a number, if it's not then you need to bung some quotes in the string as well around where wk gets concatentated in.

This discussion is closed to new replies.