Dim number
Dim dbcheck
Dim Reg_num
' Create the conection object.
Set dbcheck = createobject("ADODB.Connection")
' Set the connection string and open the connection
dbcheck.open ("DSN=DATABASE=*****; Trusted_Connection=Yes;")
number = 4001
' Get the recordset returned from a select query.

Set recordset = dbcheck.Execute("SELECT Number from Table WHERE
RegNum = "& number)
msgbox recordset.GetString 'displaying value 4001 cause the value exists in database.
Reg_num = recordset.GetString
If Reg_num = "" then
Msgbox "is null"
msgbox "is not null"
end if

Set dbcheck = Nothing

Can anybody help me with this code.near If gives error message.
msgbox recordset.GetString gives a value. I want to use that value for further functional tests using if conditions. Thanks in advance.