View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brent Brent is offline
external usenet poster
 
Posts: 109
Default if statement with sql

I want to do a something like:

if rs.Open "SELECT PRIMARY_KEY FROM TEST WHERE PRIMARY_KEY LIKE '" & _
variable & "%'" then

....

First, when I try this I have to put the sql statement in () or I cannot
execute. Second, this tends to always return Empty. Am I doing this right?
The connection to the database is established and rs.activeconnection=cn
declared. Thank you.

Brent