Tuesday, December 4, 2007

How to use AND OR operator

How to use AND OR operator

Use AND/OR operator

In ASP and MSSQL Server you use the AND and OR operator just like you have used in the Query Analyzer to retrieve data that meet certain requirements

Set cn = Server.CreateObject("ADODB.Connection")

cn.Open "DSN=myDSN;UID=sa;PWD=;DATABASE=pubs"

Set rs = Server.CreateObject("ADODB.Recordset")

‘ using the AND operator

SQLstr = "Delete * from employee where YEAR_BORN= 1980 AND Address=’California’"

‘ it’s like SQL statement in your SQL analyzer

Rs.open SQLstr, cn, 1,3


No comments: