[RESOLVED] Error 3705...........
VB Code:
Private Sub cbovendname_Click()
Dim intVendorId As Integer
intVendorId = cbovendname.ItemData(cbovendname.ListIndex)
[B]Set adoRs.ActiveConnection = adoCn[/B]
With adoRs
adoRs.LockType = adLockReadOnly
adoRs.CursorType = adOpenKeyset
adoRs.Open "Select * From Vendor Where ID = " & intVendorId
End With
txtlocation = adoRs!Location & ""
'adoCn.Close
End Sub
Error on Bold line
Error No 3705
Operation is not allowed when object is open
When
cbovendname_click then Corresponding Location from Datbase Shown
at first instance showing Correct but when i select the IInd Time then It shows Above Error
Re: Error 3705...........
Quote:
Originally Posted by vaishali
When cbovendname_click then Corresponding Location from Datbase Shown at first instance showing Correct but when i select the IInd Time then It shows Above Error
And that makes perfect sense. Why are you trying to open a connection that is already open?
Re: Error 3705...........
remove or comment the line. bcoz the connection you have already opened.
instead of opening like that could u try this
sql="Select * From Vendor Where ID = " & intVendorId
adoRs.Open sql,adoCn,adOpenKeyset,adLockOptimistic
Re: Error 3705...........
Dear Hack Sir,
What to modify...........
Re: Error 3705...........
Quote:
Originally Posted by vaishali
Dear Hack Sir,
What to modify...........
Open it once, leave it alone, and close it only when your application ends.
Re: Error 3705...........
Thank u so much
Hack & Ganeshmoorthy
Resolved
Dear Hack can u check out MSflexgrid Problem Posted by Vaishali
:thumb:
Re: Error 3705...........
Quote:
Originally Posted by vaishali
Thank u so much
Hack & Ganeshmoorthy
Resolved
Dear Hack can u check out MSflexgrid Problem Posted by Vaishali
:thumb:
Sure.
If this is resolved, please pull down the Thread Tools menu and click the Mark Thread Resolved button. That will let everyone know that you have your answer.
Thank you. :)
Re: Error 3705...........
Mr. Hack is right. do not open the connection often. open it once and close it when ur app is closed