|
-
Jun 12th, 2006, 09:20 PM
#1
Thread Starter
Addicted Member
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!
-
Jun 12th, 2006, 09:26 PM
#2
-
Jun 12th, 2006, 09:31 PM
#3
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.
-
Jun 12th, 2006, 09:58 PM
#4
Thread Starter
Addicted Member
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!
-
Jun 12th, 2006, 10:06 PM
#5
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:
Option Explicit
'Reference: M$ ActiveX Data Objects 2.X Library
Private Sub Form_Load()
Dim strSQL As String
Dim rst As ADODB.Recordset
Dim cnn As ADODB.Connection
On Error GoTo Err_Handler
Set rst = New ADODB.Recordset
Set cnn = New ADODB.Connection
strSQL = "SELECT [LastName] FROM [tblCustomers]"
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Customers.mdb;Persist Security Info=False;"
rst.CursorLocation = adUseClient 'Set to enable Cursor movement
rst.Open strSQL, cnn, adOpenForwardOnly, adLockOptimistic
'Check RS for data
If Not rst.BOF And Not rst.EOF Then
rst.MoveFirst
'Load the ListBox with the Last names
Do Until rst.EOF
List1.AddItem rst.Fields("LastName").Value
rst.MoveNext
Loop
End If
rst.Close
cnn.Close
Set rst = Nothing
Set cnn = Nothing
Exit Sub
Err_Handler:
If Not (rst Is Nothing) Then
If rst.State = adStateOpen Then
rst.Close
Set rst = Nothing
End If
End If
If Not (cnn Is Nothing) Then
If cnn.State = adStateOpen Then
cnn.Close
Set cnn = Nothing
End If
End If
MsgBox "Description: " & Err.Description & vbCrLf & _
"Number: " & Err.Number, vbOKOnly + vbInformation, "Error - Called from " & Me.Name & " Sub Form_Load"
End Sub
-
Jun 12th, 2006, 10:16 PM
#6
Thread Starter
Addicted Member
Re: kill the .ldb file?
VB Code:
Dim sfile As String
sfile = App.Path & "\messages.mdb"
Set db = OpenDatabase(sfile)
With db
Set rstComm = .OpenRecordset("select * from [message] where [Type] = 'Internet'")
With rstComm
.MoveFirst
Do While Not .EOF
List1.AddItem .Fields("name")
.MoveNext
DoEvents
Loop
End With
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|