473,396 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Pass Through DDL SQL to Oracle Express via ODBC - Run-time Error '3003'

I'm experimenting with using Access 2k2 as a front end to Oracle
Express. I am creating 10 tables using pass through DDL queries. The
PROBLEM is the general format of the VB code WORKS on the 1st 6 tables
created, then an error is thrown which I can't find much help on. I've
compared the code on the 6th table to the 5th which is successful, and
the general format is the same. It seems the more you try, the quicker
the problem is created. Re-booting fixes the problem, but the error
always 1st occurs on the 6th table created at first with subsequent
tries occurring quicker. On subsequent tries I always drop the tables
with cascading constraints and a purge. The specifics are below. Any
ideals? Thanks!

Error Message:
Run-time error '3003':
Could not start transaction; too many transactions already nested.

VB code on error:
Set qdfPassThrew = dbCur.CreateQueryDef("")

ODBC driver:
I'm using the ODBC driver that came with Oracle Database 10g Express
Edition, sqora32.dll, Oracle in XE.

VB Code on 6th table:
Sub Create_tblRevenueCurYr()
Dim wsCur As DAO.Workspace
Dim dbCur As DAO.Database
Dim qdfPassThrew As DAO.QueryDef
Dim strSQL As String

Set wsCur = DBEngine.Workspaces(0)
Set dbCur = wsCur.Databases(0)

strSQL = "CREATE TABLE sc.tblRevenueCurYr " & _
"( " & _
"InvcNo int " & _
"CONSTRAINT PK_InvcNo_RevCY PRIMARY KEY, " & _
"OrderNo int NOT NULL, " & _
"PdInvc char(6) NOT NULL, " & _
"InvcAmt number(21,0) NOT NULL, " & _
"InvcCGS number(21,0) NOT NULL " & _
");"
' Debug.Print strSQL
'create query
Set qdfPassThrew = dbCur.CreateQueryDef("")
qdfPassThrew.Connect = "ODBC;" & ConnectSC()
qdfPassThrew.SQL = strSQL
qdfPassThrew.ReturnsRecords = False
wsCur.BeginTrans
qdfPassThrew.Execute
Set qdfPassThrew = Nothing
Set dbCur = Nothing
Set wsCur = Nothing
End Sub

--
Regards,

Greg Strong
Jul 3 '06 #1
2 4014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You don't have a CommitTrans. Change to this:

....
wsCur.BeginTrans
qdfPassThrew.Execute
wsCur.CommitTrans
Set qdfPassThrew = Nothing
....

You actually don't need the Transactions since you're doing pass thru
queries for one command, Transactions are usually for 2, or more,
commands. Anyway, the best place to do the transaction is on the Oracle
server using Oracle transaction commands.

You can also save time by creating a pass-thru QueryDef by hand and just
change the SQL property before running it. E.g.:

Sub RunQuery(strSQL As String, strQuery As String)
'In:
' strSQL The command to run
' strQuery The pass-thru query to use
'
CurrentDb.QueryDefs(strQuery).SQL = strSQL

CurrentDb.QueryDefs(strQuery).Execute

End Sub

Add your own error traps.

--
MGFoster:::mgf00 <atearthlink <decimal-pointnet
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRKmCUYechKqOuFEgEQKBYwCghRE4lzf4SbFT0KheRCghWT vxMkkAni4k
isXmTr6j9r+DeS59/jp8ThOs
=g5rB
-----END PGP SIGNATURE-----
Greg Strong wrote:
I'm experimenting with using Access 2k2 as a front end to Oracle
Express. I am creating 10 tables using pass through DDL queries. The
PROBLEM is the general format of the VB code WORKS on the 1st 6 tables
created, then an error is thrown which I can't find much help on. I've
compared the code on the 6th table to the 5th which is successful, and
the general format is the same. It seems the more you try, the quicker
the problem is created. Re-booting fixes the problem, but the error
always 1st occurs on the 6th table created at first with subsequent
tries occurring quicker. On subsequent tries I always drop the tables
with cascading constraints and a purge. The specifics are below. Any
ideals? Thanks!

Error Message:
Run-time error '3003':
Could not start transaction; too many transactions already nested.

VB code on error:
Set qdfPassThrew = dbCur.CreateQueryDef("")

ODBC driver:
I'm using the ODBC driver that came with Oracle Database 10g Express
Edition, sqora32.dll, Oracle in XE.

VB Code on 6th table:
Sub Create_tblRevenueCurYr()
Dim wsCur As DAO.Workspace
Dim dbCur As DAO.Database
Dim qdfPassThrew As DAO.QueryDef
Dim strSQL As String

Set wsCur = DBEngine.Workspaces(0)
Set dbCur = wsCur.Databases(0)

strSQL = "CREATE TABLE sc.tblRevenueCurYr " & _
"( " & _
"InvcNo int " & _
"CONSTRAINT PK_InvcNo_RevCY PRIMARY KEY, " & _
"OrderNo int NOT NULL, " & _
"PdInvc char(6) NOT NULL, " & _
"InvcAmt number(21,0) NOT NULL, " & _
"InvcCGS number(21,0) NOT NULL " & _
");"
' Debug.Print strSQL
'create query
Set qdfPassThrew = dbCur.CreateQueryDef("")
qdfPassThrew.Connect = "ODBC;" & ConnectSC()
qdfPassThrew.SQL = strSQL
qdfPassThrew.ReturnsRecords = False
wsCur.BeginTrans
qdfPassThrew.Execute
Set qdfPassThrew = Nothing
Set dbCur = Nothing
Set wsCur = Nothing
End Sub
Jul 3 '06 #2
On Mon, 03 Jul 2006 20:47:19 GMT, MGFoster <me@privacy.comwrote:
>You don't have a CommitTrans. Change to this:
Yep my mistake. I'm learning!!! :) Thanks!

--
Regards,

Greg Strong
Jul 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: xtanto | last post by:
Hi All, We need to develope application & report that run on windows accessing Oracle on Linux. and we use Crystal Report as reporting tool. Can Crystal Report on windows access...
1
by: Eirik Tryggeseth | last post by:
During deployment of an application using distributed transactions managed under COM+ on an Oracle 9i RAC database, we encounter situations where the load balancing mechanisms in the RAC result in...
4
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript...
1
by: Bruce Hensley | last post by:
In Access 97, I have successfully created a DSN-less pass-thru query to Oracle using the MS ODBC For Oracle driver. I used a connection string like this: ODBC;Driver={Microsoft ODBC For...
11
by: DFS | last post by:
Architecture: Access 2003 client, Oracle 9i repository, no Access security in place, ODBC linked tables. 100 or so users, in 3 or 4 groups (Oracle roles actually): Admins, Updaters and ReadOnly....
1
by: henk | last post by:
Hello, I want make a database connection to an Oracle db (8i) with Visual Basic 2005 express BETA 2. I already installed Oracle Data Provider for .NET...
1
by: Crazy Cat | last post by:
Hi, I created a linked server for MS SQL Server 2005 Express to an Oracle database using the OLE DB Provider for ODBC. My ODBC Source uses the Microsoft ODBC for Oracle driver. I'm using the...
9
by: Greg Strong | last post by:
Hello All, What is the maximum length of an ODBC pass through query? Things work fine with the code except when I try to create a view which is pretty complex in Oracle. I'm using a DSN...
1
by: shaguna.dhall | last post by:
I need to migrate Unicode data from MS Access to Oracle. Have tried the following: -Exported the Access tables to csv/txt, but these files were generated in ANSI encoding, and the Unicode data...
11
by: funky | last post by:
hello, I've got a big problem ad i'm not able to resolve it. We have a server running oracle 10g version 10.1.0. We usually use access as front end and connect database tables for data extraction....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.