Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reading an access database from ABAP report

former_member498918
Participant
0 Kudos
102

SORRY. I HAVE NOW SOLVED THE PROBLEM. I WAS JUST MISSING THE WORD FROM IN THE STATEMENT.

I'm trying to read a table from an Access database using OLE2.

The first part of my code seems to work when opening the databse. I get sy-subrc = 0.

CONCATENATE 'Provider=' '''Microsoft.Jet.OLEDB.4.0''' ';'

INTO SQL.

CONCATENATE SQL 'Data Source=' '''
my.mdb''' ';'

INTO SQL.

CONCATENATE SQL 'Mode=' '''Share Deny None'''

INTO SQL.

  • MDB connection ...

CALL METHOD OF CON 'Open'

EXPORTING #1 = SQL.

However when I try to select from the database table using the code below I get sy-subrc = 2.

  • Query (select) statement ...

SQL = 'select * myTable'.

  • Query run ...

CALL METHOD OF REC 'Open'

EXPORTING #1 = SQL

#2 = CON

#3 = '1'.

Does anyone know what I'm doing wrong?

Thank you

Karen

Edited by: Karen Dean on Nov 4, 2010 7:15 AM

1 ACCEPTED SOLUTION

guillaume-hrc
Active Contributor
0 Kudos
62

OUPS... SKIP READING THE FIRST LINE

Hi,

Isn't there a missing FROM in your SELECT statement ?

Just for reference : https://wiki.sdn.sap.com/wiki/display/Snippets/ReadingdatafromMSAccess+table

Best regards,

Guillaume

Edited by: Guillaume Garcia on Nov 4, 2010 12:17 PM

2 REPLIES 2

guillaume-hrc
Active Contributor
0 Kudos
63

OUPS... SKIP READING THE FIRST LINE

Hi,

Isn't there a missing FROM in your SELECT statement ?

Just for reference : https://wiki.sdn.sap.com/wiki/display/Snippets/ReadingdatafromMSAccess+table

Best regards,

Guillaume

Edited by: Guillaume Garcia on Nov 4, 2010 12:17 PM

former_member498918
Participant
0 Kudos
62

SOLVED