Solved

Reading data from SAP to Delphi

Posted on 2006-11-01
5
689 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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