using New ADODB.Recordset to Find

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

pray tell why when
in a form Open event to get some stuff I go
--
. . .
rst1.Open "tblInfo", , adOpenKeyset, adLockPessimistic, _
adCmdTable
.. . . then
rst1.Close
Set rst1 = Nothing
. . .

sometimes my form doesn't make it open and I see msg
'runtime -2147467259(80004005) db placed in a state . . .
prevent being opened or looked at'
?
 
Jim,

You are opening the table, running some code then closing
the table. Is the forms data source the same table you
are trying to open? I use ADODB to open tables like this:

Dim ccn As New ADODB.Connection
Dim rst1 As New ADODB.Recordset
Set ccn = CurrentProject.Connection

rst1.Open "yourtablename", ccn, adOpenKeyset,
adLockOptimistic
code.........
code..........
rst1.Close

rst1 = Nothing
 
that could be it, I was just pessimistic, however,
I made up this different .mdb to keep my automatic stuff in and it is from there I am connecting to my main db. Appreciate it, I'll try the adjustment.
 
Jim,

Try this method to create a linked table, hide it, then
delete it when your done. Reference this Microsoft
Knowledge Base Article - 209841
http://support.microsoft.com/default.aspx?scid=kb;en-
us;209841&Product=acc2000

JimB
-----Original Message-----
J.B., you say and I believe you,
it's not working; it'll work once, I have a bug, I fix
that, and then try it and it errors out says table
inaccessible, locked and so forth.
.. . .
rst1.ActiveConnection
= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
 
Back
Top