?
Solved

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

Posted on 2004-04-21
2
Medium Priority
?
2,094 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

743 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