Jacob Hilderbrand
04-20-2007, 01:53 PM
Hi
I have a visual studio vb.net app that I am using. Data is stored in an Access database on a shared folder. It is currently an open share and everyone has full access.
When a user saves or retrieves data I us a connection string to pull the data from the database, or save it.
So far it is working fine, and we have multiple users with no issues.
Well today I noticed that there is an LDB file being saved. The thing is, this file stays there until the user completely closes the vb app. I would think that it should close when the Record Set was closed, but maybe I am mistaken.
The only issue I have noticed so far is I tried to open the database to compact and repair in and got an error that the file was opened exclusively by someone else. The db has a password so noone could open it directly.
Here is the code I use to retrieve data:
Dim i As Integer
Dim n As Integer
Dim Fld As Object
Const adOpenForwardOnly As Integer = 0
Const adLockReadOnly As Integer = 1
Const adCmdText As Integer = 1
RS = CreateObject("ADODB.Recordset")
RS.Open(StrSQL, Connect, adOpenForwardOnly, adLockReadOnly, adCmdText)
ReDim DBArray(0 To 0)
If Not RS.EOF Then
DBArray = RS.GetRows
Rows = UBound(DBArray, 2) + 1
Else
Rows = 0
End If
RS.Close()
RS = Nothing
Any ideas on what I am missing?
Thanks
I have a visual studio vb.net app that I am using. Data is stored in an Access database on a shared folder. It is currently an open share and everyone has full access.
When a user saves or retrieves data I us a connection string to pull the data from the database, or save it.
So far it is working fine, and we have multiple users with no issues.
Well today I noticed that there is an LDB file being saved. The thing is, this file stays there until the user completely closes the vb app. I would think that it should close when the Record Set was closed, but maybe I am mistaken.
The only issue I have noticed so far is I tried to open the database to compact and repair in and got an error that the file was opened exclusively by someone else. The db has a password so noone could open it directly.
Here is the code I use to retrieve data:
Dim i As Integer
Dim n As Integer
Dim Fld As Object
Const adOpenForwardOnly As Integer = 0
Const adLockReadOnly As Integer = 1
Const adCmdText As Integer = 1
RS = CreateObject("ADODB.Recordset")
RS.Open(StrSQL, Connect, adOpenForwardOnly, adLockReadOnly, adCmdText)
ReDim DBArray(0 To 0)
If Not RS.EOF Then
DBArray = RS.GetRows
Rows = UBound(DBArray, 2) + 1
Else
Rows = 0
End If
RS.Close()
RS = Nothing
Any ideas on what I am missing?
Thanks