Mitch Swetsky
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("EmpNa me")
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.EMP L_NO) = '"& Vnum & "') "
In my Access linked db the following works:
WHERE (((DBA1_TTHEM0_EMPLOYEE.EM PL_NO) Like "*vnum*")) OR (((DBA1_TTHEM0_EMPLOYEE.EM PL_NAME) Like "*vname*"));
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("EmpNa
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
strSQL = "SELECT * From DBA1.TTHEM0_EMPLOYEE ((DBA1.TTHEM0_EMPLOYEE.EMP
In my Access linked db the following works:
WHERE (((DBA1_TTHEM0_EMPLOYEE.EM
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER