Solved

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

Posted on 2004-04-21
2
2,069 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
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

760 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

20 Experts available now in Live!

Get 1:1 Help Now