Solved

ORACLE Error 00936

Posted on 2011-03-01
4
388 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 143

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can i Import Access Table Into Oracle Using Toad 36 223
sort a spool into file output in oracle 1 44
error in my cursor 5 41
oracle numeric condition check 4 27
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to recover a database from a user managed backup

837 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