Solved

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

Posted on 2004-04-21
2
2,084 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 70

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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 …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

830 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