Solved

ORACLE Error 00936

Posted on 2011-03-01
4
379 Views
Last Modified: 2013-12-07
Below is the code I am using in an Access module. I've step through everything and I know the connection works fine; but, I am getting errors at the "ODBCRecordset1.Open" line. I would like to be able to run this each night then loop through the values and paste them into another table (in access). I have done this succesfully with other Oracle DB's but cant seem to get this one to work. The errors I get most frequenty are "ORA-00936 - Missing Expression" and "ORA- 00933 - SQL not properly ended"
Also, initially there were some WHERE clauses but even after I removed them I got the same errors

Any help would be great.



Public Function Connect()

Const adlockoptimistic = 3
Const adopenstatic = 3
Const aduseclient = 3


Dim ODBCConnectionString
Dim ODBCRecordset1


Set ODBCConnectionString = CreateObject("ADODB.connection")
Set ODBCRecordset1 = CreateObject("ADODB.recordset")



ODBCConnectionString.Open "Driver=Microsoft ODBC for Oracle;Server=-----;Uid=----;Pwd----;"
ODBCConnectionString.CommandTimeout = 1200
ODBCRecordset1.Open "SELECT [TECSDAT-XLPD].[PKG_XCP_RPT_DT], [TECSDAT-XLPD].[PKG_XCP_RPT_CNY_CD], [TECSDAT-XLPD].[PKG_TCK_NR], [TECSDAT-XLPD].[PKG_XCP_RSN_CD], [TECSDAT-XLPD].[SHR_AC_NR] FROM [TECSDAT-XLPD]", ODBCConnectionString, adopenstatic, adlockoptimistic


ODBCConnectionString.Close

End Function

Open in new window

0
Comment
Question by:JClayton7
  • 2
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35008931
in Oracle, don't use [object _name], but "object_name"

0
 
LVL 15

Expert Comment

by:Aaron Shilo
ID: 35010053
hi
line 19 is wrong

fix : ODBCRecordset1.Open "SELECT TECSDAT-XLPD.PKG_XCP_RPT_DT, TECSDAT-XLPD.PKG_XCP_RPT_CNY_CD, TECSDAT-XLPD.PKG_TCK_NR, TECSDAT-XLPD.PKG_XCP_RSN_CD, TECSDAT-XLPD.SHR_AC_NR FROM TECSDAT-XLPD", ODBCConnectionString, adopenstatic, adlockoptimistic


0
 

Accepted Solution

by:
JClayton7 earned 0 total points
ID: 35010331
Thanks everyone! Ended up being t."fieldname" - I think its a table alias problem
0
 

Author Closing Comment

by:JClayton7
ID: 35431187
Figured out the answer before anyone posted it
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Delphi selector screen 2 58
levels for reporting 5 51
VB.Net - CSV to Oracle table 4 32
Oracle and DateTime math 6 15
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now