Cant add records to Oracle table using ODBC Direct 
Author Message
 Cant add records to Oracle table using ODBC Direct

Ive tried both the ODBCDirect and linked table method and both fail,
reporting ODBC call failed (3146) when attempting to update the newly
added record.  However, if I open the linked table (interactive MS
Access, so to speak), I can add records, so I dont think its a
privilege problem.

Im using:

Win 98, 4.10.1998
Access 2000, 9.0.3821 SR-1
Oracle73 ODBC driver, v2.00.03.01

Sample code:

Set wrkODBC = CreateWorkspace("", "", "", dbUseODBC)
Set conODBC = wrkODBC.OpenConnection("", ,
False, "ODBC;DSN=test.server.name;UID=user;PWD=pass;")

Set rstOutput = conODBC.OpenRecordset("IMAGEDATA", dbOpenDynamic, 0,
dbOptimistic)

rstOutput.AddNew

rstOutput!imageid = "test"
rstOutput!filename = "test"
rstOutput!filesize = 1

rstOutput.Update BOMBS HERE

Thanks,

Jeremy

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Tue, 21 Jan 2003 03:00:00 GMT  
 Cant add records to Oracle table using ODBC Direct
Jeremy,
Don't know whether this is the same but I had some problems a while age writing to a DBII table and had to use "dbInconsistent" to
get it to work.
I think I had to actually set the query properties in the QBE grid to "Dynaset (Inconsistent Updates)".
But...
Set rstOutput = conODBC.OpenRecordset("IMAGEDATA", dbOpenDynamic, 0, dbInconsistent)
...may work for you.
--
Hope This Helps,
Jeff Davies
Quote:

> I've tried both the ODBCDirect and linked table method and both fail,
> reporting "ODBC call failed (3146)" when attempting to update the newly
> added record.  However, if I open the linked table (interactive MS
> Access, so to speak), I can add records, so I don't think it's a
> privilege problem.

> I'm using:

> Win 98, 4.10.1998
> Access 2000, 9.0.3821 SR-1
> Oracle73 ODBC driver, v2.00.03.01

> Sample code:

> Set wrkODBC = CreateWorkspace("", "", "", dbUseODBC)
> Set conODBC = wrkODBC.OpenConnection("", ,
> False, "ODBC;DSN=test.server.name;UID=user;PWD=pass;")

> Set rstOutput = conODBC.OpenRecordset("IMAGEDATA", dbOpenDynamic, 0,
> dbOptimistic)

> rstOutput.AddNew

> rstOutput!imageid = "test"
> rstOutput!filename = "test"
> rstOutput!filesize = 1

> rstOutput.Update 'BOMBS HERE

> Thanks,

> Jeremy

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Fri, 24 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Cant add record using ADO!!!! Nightmare

2. ADO2.5, can't add new record to an empty table using record binding

3. adding records into an oracle table

4. Help with adding new record to Oracle table Via VB5.0

5. need something like foreach record in table - add record to another table

6. Cannot add record to Visual Foxpro table after deleting all records in table

7. Accessing Linked Oracle Tables in Access Using ODBC in VB

8. ODBC Direct and Oracle 7

9. ODBC Direct and Oracle

10. Direct connection to Oracle without ODBC?

11. ODBC Direct and Oracle

12. Copy fields from record in table A to record in table B using VBA

 

 
Powered by phpBB® Forum Software