Results 1 to 6 of 6

Thread: kill the .ldb file?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    163

    kill the .ldb file?

    I'm writing a program that uses an access backend. what i'm wondering if there is a way to kill the ldb file. I have the mdb file disguised as a .dll but when the program opens the ldb file shows. Is there a way to stop this?
    If this post has helped you please rate it by clicking the scales to the left of this post!

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: kill the .ldb file?

    No!!!

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: kill the .ldb file?

    My guess is your using Access as a FrontEnd to the BackEnd MDB file.

    Create a VB(6) FrontEnd - that way you wont get a LockFile.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    163

    Re: kill the .ldb file?

    bruce can you elaborate? I'm using vb as a "frontend"...or at least i thought i was
    If this post has helped you please rate it by clicking the scales to the left of this post!

  5. #5
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: kill the .ldb file?

    Maybe you are opening the MDB with some multiple use option.

    This is what I am using (no LockFile):
    VB Code:
    1. Option Explicit
    2.  
    3. 'Reference: M$ ActiveX Data Objects 2.X Library
    4.  
    5. Private Sub Form_Load()
    6. Dim strSQL As String
    7. Dim rst As ADODB.Recordset
    8. Dim cnn As ADODB.Connection
    9.  
    10. On Error GoTo Err_Handler
    11.  
    12.     Set rst = New ADODB.Recordset
    13.     Set cnn = New ADODB.Connection
    14.  
    15.     strSQL = "SELECT [LastName] FROM [tblCustomers]"
    16.  
    17.     cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Customers.mdb;Persist Security Info=False;"
    18.  
    19.     rst.CursorLocation = adUseClient 'Set to enable Cursor movement
    20.     rst.Open strSQL, cnn, adOpenForwardOnly, adLockOptimistic
    21.  
    22.     'Check RS for data
    23.     If Not rst.BOF And Not rst.EOF Then
    24.  
    25.         rst.MoveFirst
    26.  
    27.         'Load the ListBox with the Last names
    28.         Do Until rst.EOF
    29.             List1.AddItem rst.Fields("LastName").Value
    30.             rst.MoveNext
    31.         Loop
    32.  
    33.     End If
    34.  
    35.     rst.Close
    36.     cnn.Close
    37.  
    38.     Set rst = Nothing
    39.     Set cnn = Nothing
    40.  
    41. Exit Sub
    42.  
    43. Err_Handler:
    44.  
    45.     If Not (rst Is Nothing) Then
    46.         If rst.State = adStateOpen Then
    47.             rst.Close
    48.             Set rst = Nothing
    49.         End If
    50.     End If
    51.  
    52.     If Not (cnn Is Nothing) Then
    53.         If cnn.State = adStateOpen Then
    54.             cnn.Close
    55.             Set cnn = Nothing
    56.         End If
    57.     End If
    58.  
    59.     MsgBox "Description: " & Err.Description & vbCrLf & _
    60.         "Number: " & Err.Number, vbOKOnly + vbInformation, "Error - Called from " & Me.Name & " Sub Form_Load"
    61. End Sub

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    163

    Re: kill the .ldb file?

    VB Code:
    1. Dim sfile As String
    2. sfile = App.Path & "\messages.mdb"
    3.  
    4. Set db = OpenDatabase(sfile)
    5. With db
    6. Set rstComm = .OpenRecordset("select * from [message] where [Type] = 'Internet'")
    7.  With rstComm
    8.     .MoveFirst
    9.     Do While Not .EOF
    10.         List1.AddItem .Fields("name")
    11.      
    12.        
    13.         .MoveNext
    14.     DoEvents
    15.     Loop
    16. End With
    17. End With

    that is mine
    If this post has helped you please rate it by clicking the scales to the left of this post!

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