Solved

ORACLE Error 00936

Posted on 2011-03-01
4
389 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need SQL Query to Find Foreign-keys Without Indexed Columns 4 33
Fill Date time Field 12 29
error doing substr 3 33
Oracle SQL Developer - SubString 2 23
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup

735 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