I downloaded a source code VB6 about pharmacy program and its work but i always got this error

Run-time error 3709
The connection cannot be used to perform this operation. It is either closed or invalid in this context
and after i click on Debug i found this code
Code:
rs.Open "Select Billno from Orders", cn, adOpenKeyset, adLockOptimistic
and this is the complete code
Code:
Private Sub NewMode()
rs.Open "Select Billno from Orders", cn, adOpenKeyset, adLockOptimistic

If rs.EOF Or rs.BOF Then
Me.Text1(0).Text = 1
Else
rs.MoveLast
Text1(0).Text = rs.Fields(0) + 1
End If

Text1(1) = Date
Text1(2) = ""
Text1(3) = 0
Text1(4) = 0
Text1(5) = 0
iGrid1.Clear True
Set rs = Nothing
End Sub
The source code which i downloaded in this website
http://www.planet-source-code.com/vb...68020&lngWId=1