|
-
Apr 27th, 2001, 07:08 PM
#1
Thread Starter
New Member
VB6 w/SQL2000 w/ADO question
OK, OK, so this might be a little complicated. I'm using VB6 and SQLServer2000. I'm looking for a way to trap an error I am receiving on the line:
adoCityStateID.Refresh
I receive error #3704 - Operation is not allowed when object is closed. The funny thing is this operation works great and it's fast as lightning! If I remove the line, the update does not work. Even with error trapping, I can't seem to remove the error so the operator doesn't know it happens.
Any Ideas?
SQL = "UPDATE TCityStateID" _
& " SET TCityStateID.SalesRepID = '" & dbcSalesRep.BoundText & "'" _
& " FROM TCityStateID"
If dbcStateName <> "<select>" Then
SQL = SQL & " WHERE StateName= '" & dbcStateName & "'"
End If
If dbcCountyName <> "<all>" Then
SQL = SQL & " WHERE CountyName + ', ' + StateName= '" & dbcCountyName & "'"
End If
If dbcCityName <> "<all>" Then
SQL = SQL & " WHERE CityName + ', ' + StateName = '" & dbcCityName & "'"
End If
adoCityStateID.RecordSource = SQL
On Error Resume Next
adoCityStateID.Refresh
MsgBox "Update Completed! Just igone that error.", vbOKOnly, "Update Confirmation"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|