Solved

Reading data from SAP to Delphi

Posted on 2006-11-01
5
664 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Always welcome. If you have problems in the real situation, drop a post here.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now