Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access DB Connection.

Posted on 2003-11-09
3
Medium Priority
?
197 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

618 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