Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reading data from SAP to Delphi

Posted on 2006-11-01
5
Medium Priority
?
721 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 2000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Loops Section Overview

963 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