Question : ';' in union

is the ';' required at the end of the first select statement?

select a,b,c from a123;
union
select a,b,c from b123;

vs

select a,b,c from a123
union
select a,b,c from b123;

Answer : ';' in union

If you are concerned about speed than use a Forward=Only and not a Keyset cursor.  And if you want simplicity, than this is the simplest you are going to get:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
Dim ConnObj As ADODB.Connection
Dim RS As ADODB.Recordset
Dim SQL As String

Set ConnObj = New ADODB.Connection
    
'CONNECTION STRING TO SQL DATABASE
ConnObj.Open _
        "Provider = sqloledb;" & _
        "Data Source=69.62.203.176,1433\pe1850sql;" & _
        "Initial Catalog=GOUAL;" & _
        "User ID=sa;" & _
        "Password=***********;"
        
SQL = "SELECT 1 FROM INVDETAILS INNER JOIN PROFILES ON INVDETAILS.UAID = PROFILES.UAID " & _
" WHERE INVDETAILS.SVCCODE='" & XSCODE & "' AND PROFILES.FNO='" & paddedFN & "' " & _
" AND INVDETAILS.PASSCODE='" & PassCode & "' AND INVDETAILS.ACTIVE=1; "
Set RS = ConnObj.Execute(SQL)

RecordFound = NOT RS.EOF

RS.Close
ConnObj.Close

Set RS = Nothing
Set ConnObj = Nothing
Random Solutions  
 
programming4us programming4us