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
|