Writing directly to linked tables in Access97 
Author Message
 Writing directly to linked tables in Access97

This is an excerpt from Access Help...

If object refers to a QueryDef, or a dynaset- or snapshot-type Recordset,
or if source refers to an SQL statement or a TableDef that represents an
attached table, you can't use dbOpenTable for the type argument; if you do,
a trappable error occurs.

Try leaving the dbOpenTable off. this should default to the recordset or
dynaset type depending on what version of Access you are using..

good luck.

--
Mark J. Brown

QuickStart Technologies, Inc.
http://www.*-*-*.com/
1500 Quail Street 6th Floor
Newport Beach, CA 92660



: I am trying to add a new record directly to a table in Access97.  Before
: I split the database into a front and back end, this worked fine.  Now
: it says it is an illegal operation.  Here is the code I used to perform
: this before I split the DB.  "CallLog" is an attached table from the
: backend.  The line that gives me the error is 'Set MyTable = .....'
:
:
: Dim MyDB As Database, MyTable As Recordset
: Set MyDB = DBEngine.Workspaces(0).Databases(0)
: Set MyTable = MyDB.OpenRecordset("CallLog", DB_OPEN_TABLE)
:
:       MyTable.AddNew
:       MyTable![CompanyName] = [CompanyName]
:       MyTable![City] = [City]
:       MyTable![State] = [State]
:       MyTable.Update
:
: I certainly appreciate any help that I receive.  Thanks in advance.
: Joe Ainsworth

:



Mon, 15 Nov 1999 03:00:00 GMT  
 Writing directly to linked tables in Access97

I am trying to add a new record directly to a table in Access97.  Before
I split the database into a front and back end, this worked fine.  Now
it says it is an illegal operation.  Here is the code I used to perform
this before I split the DB.  "CallLog" is an attached table from the
backend.  The line that gives me the error is 'Set MyTable = .....'

Dim MyDB As Database, MyTable As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MyTable = MyDB.OpenRecordset("CallLog", DB_OPEN_TABLE)

        MyTable.AddNew
        MyTable![CompanyName] = [CompanyName]
        MyTable![City] = [City]
        MyTable![State] = [State]
        MyTable.Update

I certainly appreciate any help that I receive.  Thanks in advance.
Joe Ainsworth



Mon, 15 Nov 1999 03:00:00 GMT  
 Writing directly to linked tables in Access97

Thanks to all who wrote back.  I took the suggestion of Mark Brown (
which I also found in the Solutions DB) and applied it successfully.

Thanks again!

Joe Ainsworth

Quote:

> I am trying to add a new record directly to a table in Access97.  Before
> I split the database into a front and back end, this worked fine.  Now
> it says it is an illegal operation.  Here is the code I used to perform
> this before I split the DB.  "CallLog" is an attached table from the
> backend.  The line that gives me the error is 'Set MyTable = .....'

> Dim MyDB As Database, MyTable As Recordset
> Set MyDB = DBEngine.Workspaces(0).Databases(0)
> Set MyTable = MyDB.OpenRecordset("CallLog", DB_OPEN_TABLE)

>         MyTable.AddNew
>         MyTable![CompanyName] = [CompanyName]
>         MyTable![City] = [City]
>         MyTable![State] = [State]
>         MyTable.Update

> I certainly appreciate any help that I receive.  Thanks in advance.
> Joe Ainsworth




Tue, 16 Nov 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Linking tables vs. Opening tables directly

2. read write error when attempting to write to dbo_tblCounts (Access linked table)

3. How do I use VBA to write a new recorset directly to a table

4. Access97 - Linked Tables - Primary Keys - VBA

5. link table from sql7 to access97

6. Linking to Oracle tables from Access97 via ODBC

7. Access97, Foxpro 2.6 Linked Tables

8. Access97: Get Connect property of a linked table

9. VB6 and Access97 link tables

10. Linking an Oracle table to an Access97 db using ADO

11. Changing the linked table path without the linked table manager

12. Is it wise to link to SQL directly ?

 

 
Powered by phpBB® Forum Software