Link to home
Create AccountLog in
Avatar of Mitch Swetsky
Mitch SwetskyFlag for United States of America

asked on

ASP Sql statement inside VBA problem with Quotes

I am trying to create a query that will look at an oracle table DBA1.TTHEM0_EMPLOYEE
Where Vnum is like '%VEMPL_NO%' or Vname is like '%VEMPL_Name%'  

I have 2 form fields coming in
Vnum = Request.QueryString("EmpNo")
Vname = Request.QueryString("EmpName")

Can someone help me convert the strSQL below to look for Like parts of either field?
I get confused with my quotes all the time and the wildcard % gives me an error in string message.

' Define List Record Set
Set rs = Server.CreateObject("ADODB.Recordset")      
strSQL = "SELECT * From DBA1.TTHEM0_EMPLOYEE ((DBA1.TTHEM0_EMPLOYEE.EMPL_NO) = '"& Vnum & "') "

In my Access linked db the following works:
WHERE (((DBA1_TTHEM0_EMPLOYEE.EMPL_NO) Like "*vnum*")) OR (((DBA1_TTHEM0_EMPLOYEE.EMPL_NAME) Like "*vname*"));
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Mitch Swetsky

ASKER

Thanks, I am able to work with this. I appreciate your prompt response