sizer Posted May 3, 2003 Posted May 3, 2003 try Dim myStr as String="5" dim query as String query="SELECT * FROM somewhere WHERE something= " & myStr Quote Some people are wise and some are other-wise.
sizer Posted May 3, 2003 Posted May 3, 2003 String myStr="4"; String myQuery; myQuery="SELECT * FROM somewhere WHERE something=" + myStr; Quote Some people are wise and some are other-wise.
sizer Posted May 3, 2003 Posted May 3, 2003 more complex ---> String myStr ="Customers"; String myStr1="4"; String myStr2="id"; String myQuery; myQuery="SELECT * FROM" + myStr + " WHERE " + myStr2 + "=" +myStr1; Quote Some people are wise and some are other-wise.
hog Posted May 3, 2003 Posted May 3, 2003 However if you use a string you should quote it thus: Dim myStr As String="5" Dim query As Stringquery="SELECT * FROM somewhere WHERE something= '" & myStr & "'" Quote My website
sizer Posted May 3, 2003 Posted May 3, 2003 Yes, i forgot qoutes!!! Thanks hog! String myStr ="Customers"; String myStr1="4"; String myQuery; myQuery="SELECT * FROM" + myStr + " WHERE id ='" + myStr1 + "'"; Quote Some people are wise and some are other-wise.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.