Solved

Reading data from SAP to Delphi

Posted on 2006-11-01
5
681 Views
Last Modified: 2008-02-01
Hi there

I need to read data from SAP into my Delphi program.
Is it possible?

as far as i know SAP works with MS-SQL, so what if the database is protected with a password?

I'm working only with Paradox, so i know nothing about MS-SQL database.
Can you also tell me how can i know the exact name of a specific data file?

I'm not a Delphi-pro programmer, so please bear with me and give me a good documented source for example.
i will give more then 500 points for that (or more if you want).

MANY thanks
0
Comment
Question by:ebi1
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 17854048
In most cases SAP works with Oracle. No matter it is Oracle or MSSQL, you can connect to the database using ADO or BDE. You don't have to specify filename, since they are REAL DB servers, not based on files like Paradox

some examples:
http://delphi.about.com/od/database/

With BDE you will have to setup alias in BDE Administrator, while with ADO you will have to build a connection string in the wizard. Then you can use TDatabase (for BDE) or TADOConnection (for ADO)
0
 

Author Comment

by:ebi1
ID: 17858849
hi ivanov, thanks for the reply.

can you give me a code example please?
i dont have the time to learn everything now, just the basic idea, of how to connect and maybe even make a simple query.

and i dont really know how to use ADO yet...

which way is easier to use BDE or ADO ?

what about a password protection?

thanks again
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 500 total points
ID: 17859789
Okay, here are basic things you have to do.

1) Create new Application (VCL Win32)

2) Put the following applications on the form:
  ADOConnection1 - of type TADOConnection
  ADOQuery1 - of type TADOQuery
  DataSource1 - of type TDataSource
  DBGrid1 - of type TDBGrid

3) Set DBGrid1.Datasource = DataSource1 (from Object Inspector)
  DataSource1.DataSet = ADOQuery1 (from Object Inspector)
  ADOQuery1.Connection = ADOConnection1 (from Object Inspector)

4) Create the ConnectionString for ADOConnection1. When you click on ConnectionString property a wizard is available for you.
  on the tab "Provider" choose the provider
  on the tab "connection" specify Additional parameters as Server, User, Pass, etc.
  as a result you will get a connectionstring  like:
 "Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=myUsername;Pwd=myPassword;"
 
  you can also check http://www.connectionstrings.com/

5) Click "Test connection" button to ensure that your connection is working

6) Set ADOQuery1 SQL property to the query you want, for example: SELECT * FROM table_name

7) set ADOQuery1.Active = True and the result should appear in the Grid below.

Hope this helps
0
 

Author Comment

by:ebi1
ID: 17860958
MANY thanks my friend

this is exactly what i needed.

i can test it only next week, but i saw something like that somewhere, so i'm sure it's working great.

thanks again  :)
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 17861778
Always welcome. If you have problems in the real situation, drop a post here.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

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