Results 1 to 4 of 4

Thread: help about code VB6

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    1

    help about code VB6

    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

  2. #2
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: help about code VB6

    welcome to the forum,
    in that website there are lots of things, but u told simply this is the complete code????
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  3. #3
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: help about code VB6

    Have you modified the Data Link to reflect the location of your Database? As distributed it expects the Database to be at: 'D:\VB PROJECTS\Pharmacy\Pharmacy.mdb'. The (many) 'On Error Resume Next' statement(s) is / are stopping you from seeing problems.

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: help about code VB6

    Have a read of the Database Development FAQ which, contains the answers you may need as well as useful examples too.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

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