Dim ConnObj As New ADODB.Connection 'ADODB Connection Object
Dim RS4 As New ADODB.Recordset 'Recordset Object
Dim SQL4 As String ' String variable to store sql command
'CONNECTION STRING TO SQL DATABASE
ConnObj.Open _
"Provider = sqloledb;" & _
"Data Source=69.62.203.176,1433\pe1850sql;" & _
"Initial Catalog=GOUAL;" & _
"User ID=sa;" & _
"Password=***********;"
'CHECK IF USER EXIST IN PROFILES TABLE
SQL4 = " SELECT * FROM PROFILES " & " WHERE FNO='" & paddedFN & "' "
RS4.Open SQL4, ConnObj, adOpenKeyset
If Not RS4.EOF Then
RSARRAY = RS4.getRows()
NR = UBound(RSARRAY, 2) + 1
Else
NR = 0
End If
RS4.Close
If NR > 0 Then
CUSTOMEREXISTS = True
Else
CUSTOMEREXISTS = False
GoTo Process_Variables
End If
|