?
Solved

Access DB Connection.

Posted on 2003-11-09
3
Medium Priority
?
195 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 500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 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