[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Run-time error -2147217900 (80040e14) - Invalid Sql statement - DataReport using SHAPE

Posted on 2004-04-21
2
Medium Priority
?
2,099 Views
Last Modified: 2013-12-25
Hi !

I Need a big help to ressolve this error....

Run-time error'-2147217900(80040e14)':
Invalid Sql statement; expected 'DELETE','INSERT','PROCEDURE,'SELECT', OR'UPDATE'

i use different datareport with access 2000 in VB6 SP5, WinXP, OfficeXP
I create a

DataEnvironment named : DataEnvReportCon

command named : RapSitEmpCumu
SQL :  SELECT rwu_RapSitEmpCum.* FROM rwu_RapSitEmpCum

Child Command named : RapSitEmpCumPat
SQL :  SELECT rwv_RapSitEmpCumPat.* FROM rwv_RapSitEmpCumPat ORDER BY rwv_NomPatrouil

The Hierarchy info is :
SHAPE {SELECT rwu_RapSitEmpCum.* FROM rwu_RapSitEmpCum}  AS RapSitEmpCumu APPEND ({SELECT rwv_RapSitEmpCumPat.* FROM rwv_RapSitEmpCumPat ORDER BY rwv_NomPatrouil}  AS RapSitEmpCumPat RELATE 'rwu_Id' TO 'rwu_Id') AS RapSitEmpCumPat

when i invoke the method  .Open   a GOT THIS ERROR  

Here the code :

If oCurReport.DataMember <> vbNullString Then
        ''
        With DataEnvReport.Recordsets(oCurReport.DataMember)
            ''
            If .State <> ecRepManSD_StClosed Then
                Call .Close
                DoEvents
            End If
            ''
            If .State <> ecRepManSD_StOpen Then

                Call .Open  '''  HERE TO ERROR OCCUR  WITH REPORT HOW USE HIERARCHY COMMAND

            End If
            ''
            DoEvents
            ''
            If .RecordCount > 0 Then Call .MoveFirst
            ''
            DoEvents
            ''
        End With
    End If

THIS WORK FINE for ALL OTHER DataReport With NO HIERARCHY COMMANDS.

Here the connection string :
Provider=Microsoft.Jet.OLEDB.4.0;Password=veloXX;User ID=veloXXX;Data Source=T:\VsDbRep.mdb;Persist Security Info=True;Jet OLEDB:System database=T:\VsDbOps.MDW

Someone got an idea ?
Is the Field definition , connection string ????  dont know....  :-(

This one work fine:
SELECT rwc_StatsTypInFull.* FROM rwc_StatsTypInFull ORDER BY rwc_ColNomPat


Thanks
Eric.
0
Comment
Question by:BeerMan
[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 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 10887293
You connection string needs to specify that you are using Shape. See http://www.able-consulting.com/MDAC/ADO/Connection/DataShape.htm#MSDataShapeSQLServer
0
 
LVL 1

Author Comment

by:BeerMan
ID: 10888882
Work really fine  thanks to you  emorea.

Eric.
0

Featured Post

Industry Leaders: 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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

650 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