Solved

Reading data from SAP to Delphi

Posted on 2006-11-01
5
674 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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