Database Splitter results in Illegal Operation

S

ScottB

I created a test database with one small table and one
form. The form has one button on it that activates the
following event (copied in part):
Private Sub Command0_Click()
Dim curdb As DAO.Database
Dim rst As DAO.Recordset
Dim nm as String

Set curdb = CurrentDB
Set rst = curdb.OpenRecordset ("Table1", dbOpenTable)

With rst
....

The form, in fact works fine "until" I used the Database
Splitter to separate it into front and back ends. Then,
when I try to use the same form it gives me an Illegal
Operation error (3219) and crashes on the line reading
Set rst = curdb.OpenRecordset ("Table1", dbOpenTable)

I suspect this may have to do with something in the
reference library but am a bit lost at this stage. Any
sage words of advice would be appreciated. Scott
 
N

Nick Coe

Scott,

Check the references by opening some VBcode in design view
then select Tools|References from the menu bar at the top.

Access 2000 and onwards don't include the DAO libs by
default so you could be on the right track though having the
exact error message would help narrow things down a bit.

There are various versions of the DAO libs around depending
on what ver of Access you're running and I think some of the
operating system service packs and updates may change them.
Installing some applications or updating them can also add
later libs to the brew.

The version on my Acc2kSR1etc WinXPProSP1 system is
'Microsoft DAO 3.51 Object Library'. You may find 3.6 on
there as well. However, you only need one checked.

Be interested to hear what you find and what the error
message is.

Good luck
Nick Coe (UK)
www.alphacos.co.uk
 
S

ScottB

I checked the reference library and have "Microsoft DAO
3.6 Object Library" selected (along with Visual Basic for
Applications; Microsoft Acccess 10.0 Object Library; OLE
Automation and Microsoft ActiveX Data Objects 2.1
Library). There are no other Microsoft DAO __ Object
Library" options to select from. So, I'm still
stuck...time for more research, I guess. Thanks for your
efforts on my behalf. I may have to learn a little more
ADO and rewrite the code, I guess. Scott
 
D

Dirk Goldgar

ScottB said:
I created a test database with one small table and one
form. The form has one button on it that activates the
following event (copied in part):
Private Sub Command0_Click()
Dim curdb As DAO.Database
Dim rst As DAO.Recordset
Dim nm as String

Set curdb = CurrentDB
Set rst = curdb.OpenRecordset ("Table1", dbOpenTable)

With rst
....

The form, in fact works fine "until" I used the Database
Splitter to separate it into front and back ends. Then,
when I try to use the same form it gives me an Illegal
Operation error (3219) and crashes on the line reading
Set rst = curdb.OpenRecordset ("Table1", dbOpenTable)

I suspect this may have to do with something in the
reference library but am a bit lost at this stage. Any
sage words of advice would be appreciated. Scott

Once you have split your database, Table1 is now a linked table. You
can't open a table-type recordset, as you are requesting with
dbOpenTable, on a linked table. You must specify (or allow it to
default to) dbOpenDynaset instead.

Note that this means you won't be able to use those few recordset
methods, such as Seek, that are only available with table-type
recordsets. If you have a real need to use Seek instead of the
FindFirst/FindNext methods, there's a way to work around this, by
opening a separate Database object directly on the back-end database and
using that as the basis of your OpenRecordset call so that you can open
a table-type recordset. However, most of the time that's not necessary,
and you can just use the Find... methods instead.
 

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