Results 1 to 4 of 4

Thread: SELECT

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    5

    Question

    Need help with the Select command. I use Select to retrieve particulars records from a database file. Problem is Select locks the database file to access to the selected records only. How do I unlock to provide access to other records?

    Thanks & Regards.

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    It is like this:
    In your SELECT statement you've select Field1, Field2 and Field3. But you need to access Field4 records? If yes, the you should included Field4 in your SELECT statement.

    Code:
    SELECT Field1, Field2, Field3, Field4 FROM TblName WHERE Bla... Bla... Bla...;
    Else it may be some problem in your SELECT statement? May be you can post your SELECT statement & let us have a look on it?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    5

    Smile SELECT records

    Thanks Chris and I know what you mean regarding the selected fields. But my problem is with the records. For example, if my database contains the following records
    abcd
    defg
    hijk
    and lets say my Select command selected record no. 2 which is "defg", what happens next is that the database is lock onto record no. 2 only. I am unable to access record no. 1 and 3. The system will only release when I exit and restart the program again. How can I unlock the database?

    By the way my Select statement is something like this

    Select * from patient where patname = .........

    Thanks & Regards.
    BYE

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Defienately you can not access the records No.1 and No.3, since you only select records No.2.

    So, if you wisj to access others records, all you need is just close the existing recordset and open again with another SQL statement which will select records No. 1 and 3.

    Or make sure you did lock your recordset as:
    Code:
    Dim SQL$
    SQL = "Select * from patient where patname = ......... ;"
    Set rs = db.OpenRecordset(SQL, dbOpenDynaset, , dbReadOnly)
    If yes, then just change it to...
    Code:
    Dim SQL$
    SQL = "Select * from patient where patname = ......... ;"
    Set rs = db.OpenRecordset(SQL, dbOpenDynaset)

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