Dim XyzRs As ADODB.Recordset

What happens to this line of code? In another workbook, it is okay to Dim inside userform, but why I am not able to Dim inside a module (a different workbook, XyzRs is also a different name)?

Thanks.