ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   if statement with sql (https://www.excelbanter.com/excel-programming/388528-if-statement-sql.html)

Brent

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


All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com