Results 1 to 8 of 8

Thread: [RESOLVED] Error 3705...........

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    PUNE
    Posts
    222

    Resolved [RESOLVED] Error 3705...........

    VB Code:
    1. Private Sub cbovendname_Click()
    2. Dim intVendorId As Integer
    3. intVendorId = cbovendname.ItemData(cbovendname.ListIndex)
    4.  
    5. [B]Set adoRs.ActiveConnection = adoCn[/B]
    6.  
    7. With adoRs
    8.     adoRs.LockType = adLockReadOnly
    9.     adoRs.CursorType = adOpenKeyset
    10.     adoRs.Open "Select * From Vendor Where ID = " & intVendorId
    11. End With
    12.  
    13. txtlocation = adoRs!Location & ""
    14.  
    15. 'adoCn.Close
    16.  
    17. 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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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?

  3. #3
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    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

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    PUNE
    Posts
    222

    Re: Error 3705...........

    Dear Hack Sir,

    What to modify...........

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    PUNE
    Posts
    222

    Resolved Re: Error 3705...........

    Thank u so much
    Hack & Ganeshmoorthy

    Resolved

    Dear Hack can u check out MSflexgrid Problem Posted by Vaishali


  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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

    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.

  8. #8
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Error 3705...........

    Mr. Hack is right. do not open the connection often. open it once and close it when ur app is closed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width