Solved

Access DB Connection.

Posted on 2003-11-09
3
193 Views
Last Modified: 2010-04-05
Hi Guys.

I want to write an application that will connect to a DB. I want that DB to be access.

What are my best options? I'm using Delphi7, and I have both the "DataAccess" TAB and the ADO Tab. Which are better?

Will one of them allow me to create installations that will also include the database? and will not make me use ODBC manually or things like that? can I avoid using ODBC at all?

M.
0
Comment
Question by:mertero
[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
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 125 total points
ID: 9712976
Hello

   The best way to use access with Delphi is using ADO, and you will find all what you need in the ADO tab
the "Data Access" tab is for using DataSource, it's just a component to connect the Data Controls to the ADo Table, so you will need to use both tabs for Database Application

here's a quick steps to connecto using ADO

1. From Ado tab, drop AdoConnection and AdoTable
2. Click on ConnetionString property of ADoConnection you will see the ConnectionString Dailog, press build, then choose Micorosoft Jet 4.0 OLEDB provider, press Next then choose your .Mdb file
3. in AdoTable set the Connection propery to use the AdoConnection, and choose the TableName property to choose your table, set the Active property to True
4. in the "DataAccess" tab add one datasource to the form, and set it's Dataset Property to AdoTable1
5. from "Data Controls" tab, drop DBNavigator and DBGrid components on the from, set there DataSource property to DataSource1
 Run your application, and that's be your DB App ;-)

you can replace step 4 and 5, but double click on the AdoTable, you will see the field editor, press right click and choose Add all fields, the select the fields and drag them to the form, you will see Delphi Add DBEdit components automatically and one DataSource to the form

Hope that make it clear to you

Regards,
Mohammed Nasman
0
 

Author Comment

by:mertero
ID: 9713056
Hello Mohammed.

Sounds good. I see I will not need ODBC or anything. Cool. I'll have to check that it works first...

M.
0
 

Author Comment

by:mertero
ID: 9764920
Hi again. This works great, but I have one last question. If I want to install the application in several computers, can I change this string (The Connection string) from outside the application? or do I have to put the MDB in the exact same place?

Thanks,

M.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Press three keys together and trigger a function 3 74
control image tags in a string ? 12 165
Drag & Drop... Data from one grid to another 2 51
QuickReport, Delphi, Shape 12 44
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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

738 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