Click to See Complete Forum and Search --> : variables in SQL
dwhawley
Nov 12th, 1999, 02:49 AM
does anyone know the proper syntax to insert variables into an SQL statement? the references i have and the vb help files do not seem to cover this.
Clunietp
Nov 12th, 1999, 11:27 AM
is this in MS Access?
smalig
Nov 13th, 1999, 08:35 PM
For sample:
"select * from table where numfield = " & number
"select * from table where txtfield = '" & text & "'"
------------------
smalig
smalig@hotmail.com
smalig.tripod.com (http://smalig.tripod.com)
dwhawley
Nov 14th, 1999, 07:48 PM
this will be in vb. i attempted to use a select statement very similar to what smalig suggested but things don't seem to be working properly. i've pretty much decided to cry uncle and purchased sql for dummies over the weekend.
Clunietp
Nov 15th, 1999, 10:37 AM
smalig's code looks right. You could post your code and we'll take a look....
dwhawley
Nov 16th, 1999, 09:41 PM
i actually just figured out the problem. i kept getting a message concerning incompatible data types. after i went off in several different directions, i realized that i was not using quotes. sometimes it's in the details.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.