Folks,

I need to know why my code below locks up on the line

rst.Open sourcesqlstatement, cnn, adOpenStatic, adLockOptimistic

and the program says "Not Responding" in the task bar. Please help!

My boss is in another state and needs me to send him afix withinan hour. Heellp!!!!

Thank you,
Jim

Dim rst As New ADODB.Recordset
Set cnn = CreateObject("ADODB.Connection")
cnn.ConnectionString = "Driver={SQL Server};Server=SQL;Database=" & Trim(lblDatabase.Caption) & ";Uid=sa;Pwd=;"

cnn.Open

sourcesqlstatement = "Select PartName from Part where PartName <> ''"

rst.Open sourcesqlstatement, cnn, adOpenStatic, adLockOptimistic

If rst.RecordCount > 0 Then
rst.MoveFirst
While Not rst.EOF
Value = rst.Fields("PartName")
If Value = partname Then
dbAdd = False
End If
rst.MoveNext
Wend
End If
rst.Close