ADODB

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
 
B

bruce barker

Yes, but you will have less control. in general ADODB is a lot slower then
DAO and is missing several features. some of the stuff you will be looking
for is in ADOX.

if you need performance, you will do better to write a com wrapper around
DAO (say in vb6). then create a .net wrapper around the com wrapper (vs will
do this).

better yet, switch to sqlserver.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top