Solved

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

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide vba in gp 7 94
how to know if my Checkbox is True in VB6.0? 9 55
How to read File Date Created using VB6 8 39
Send outlook email from VBS Script 2 29
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

770 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