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: 

Import data from MS ACCESS in background mode

Former Member
0 Kudos

Hello experts,

i am facing the following problem. I´ve got to import a MS ACCESS database in background mode via job.

I got a solution which works in dialoge:

create object conn 'ADODB.Connection'.
create object rsdb 'ADODB.Recordset'.

concatenate 'Provider=Microsoft.Jet.OLEDB.4.0;'
'Data Source=C:UserspfahlbeDesktopaccess.mdb'
into sql.

call method of conn 'Open'
  exporting
  #1 = sql.

Any idea how it can be handled in background?

3 REPLIES 3

former_member1115366
Active Participant
0 Kudos

The system does not have permission to the useru2019s desktop C:\Users\pfahlbe\Desktop\access.mdb when running in the background.

Recommend moving your MSAccess db to a network location where the system has full-time read-permission, and adjusting your sql accordingly.

Regards,

zKen

0 Kudos

Hello,

how do you mean that? I can access an .mdb file from SAP directly by SQL?

0 Kudos

The data source path that you have encoded into the variable u201Csqlu201D is only valid and available to the system when you run in dialogue (as you have discovered). I suggest that you put the MSAccess database into a different location, one that is on your network and available to the SAP system full-time. Then you have to adjust the data source path encoded into your variable named u201Csqlu201D so that the background job can open the MSAccess database.