M
Merlin
Hi,
In VB6 when using DAO e.t.c, it was often required to call the function
DBEngine.Idle, otherwise MS Access took ages to release record locks and
basically made concurrent use impossible.
Will I suffer the same problems with ADODB in VB.NET? if so is there a
correct method to also implement this function. or does good old ADODB do
all this for me?
Thought I'd enquire as I've found no reference to this and didn't want to be
caught out in the later stages of my project..
Another issue I have is that when I save a new record to a database and
immediatley populate a listbox, I don't get the new record, it's as if there
is a 1 second delay before the data is visible, so I miss it but get the new
record if I attempt to populate the listbox again; is this some form of
cache issue that I can flush programically.
Is there any other advice for potential problems I might get?
Below is an example of the coding standard I'm using, so it is made clear
how I'm accessing data, as there appears to many ways to achieve the same
result.
Many Thanks,
Merlin
Imports ADODB
Dim StockRec As New ADODB.Recordset
dim Sql as string
sql="SELECT * FROM SOMETHING"
StockRec = New ADODB.Recordset
StockRec.CursorLocation = CursorLocationEnum.adUseServer
StockRec.Open(Sql, _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\myserver\mydata.mdb;" & _
"user id=admin;password=;"
, _
CursorTypeEnum.adOpenKeyset, LockTypeEnum.adLockOptimistic)
Do While Not StockRec.EOF Then
'// my data pulled from loop
Stockrec.movenext
Loop
In VB6 when using DAO e.t.c, it was often required to call the function
DBEngine.Idle, otherwise MS Access took ages to release record locks and
basically made concurrent use impossible.
Will I suffer the same problems with ADODB in VB.NET? if so is there a
correct method to also implement this function. or does good old ADODB do
all this for me?
Thought I'd enquire as I've found no reference to this and didn't want to be
caught out in the later stages of my project..
Another issue I have is that when I save a new record to a database and
immediatley populate a listbox, I don't get the new record, it's as if there
is a 1 second delay before the data is visible, so I miss it but get the new
record if I attempt to populate the listbox again; is this some form of
cache issue that I can flush programically.
Is there any other advice for potential problems I might get?
Below is an example of the coding standard I'm using, so it is made clear
how I'm accessing data, as there appears to many ways to achieve the same
result.
Many Thanks,
Merlin
Imports ADODB
Dim StockRec As New ADODB.Recordset
dim Sql as string
sql="SELECT * FROM SOMETHING"
StockRec = New ADODB.Recordset
StockRec.CursorLocation = CursorLocationEnum.adUseServer
StockRec.Open(Sql, _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\myserver\mydata.mdb;" & _
"user id=admin;password=;"
, _
CursorTypeEnum.adOpenKeyset, LockTypeEnum.adLockOptimistic)
Do While Not StockRec.EOF Then
'// my data pulled from loop
Stockrec.movenext
Loop