change
 
Me.OleDbSelectCommand1.CommandText = "SELECT ST, StateName,
CEUNeeded, CEUAllwdCarryOver, SeparateME, SeparateFP " _
    & "FROM States where (Statename like %" & PubState & "% )"
for the database in oracle

Me.OleDbSelectCommand1.CommandText = "SELECT ST, StateName,
CEUNeeded, CEUAllwdCarryOver, SeparateME, SeparateFP " _
    & "FROM States where (Statename like *" & PubState & "* )"
for the database in MSAccess



Charles Parks <[EMAIL PROTECTED]> wrote:
What would be the correct syntax to use a variable after the Like
operator?

I have a textbox(TextBox1) on the form and a public variable(PubState)
declared.

My code is like this:

        PubState = TextBox1.Text

        Me.OleDbSelectCommand1.CommandText = "SELECT ST, StateName,
CEUNeeded, CEUAllwdCarryOver, SeparateME, SeparateFP " _
    & "FROM States where (Statename like PubState)"

for some reason when I execute it.  It thinks PubState is a column in
the table.

Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/visualbasic6programming/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


                
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/k7folB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To reply to this message, go to:
    
http://groups.yahoo.com/group/visualbasic6programming/post?act=reply&messageNum=17765
    Please do not reply to this message via email. More information here:
    http://help.yahoo.com/help/us/groups/messages/messages-23.html

<*> To visit your group on the web, go to:  
    http://groups.yahoo.com/group/visualbasic6programming/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to