How To Connect to a Database from Delphi XE2? ( newbie ) [Edit]

Hi all!

I'm thinking on using Firebird or Microsoft SQL Server Express - I want a free database - to create a database application.

How do I connect the database from Delphi XE2?
I was looking on the Tool Palette, and I've found "dbExpress" and "dbGo" ( I think that this last one if for ADO connection ... ).

What is the diference between "dbExpress" and an ADO connection? What is the best?

Do I need third-party components to connect to Firebird or Microsoft SQL Server Express, from Delphi XE2?


Thanks a lot in advance.

Best regards,
Joaquim.

Edited by: Joaquim Macedo on Nov 17, 2012 4:06 PM
0
Joaquim
11/18/2012 12:06:57 AM
embarcadero.delphi.database 1294 articles. 0 followers. Follow

5 Replies
3687 Views

Similar Articles

[PageSpeed] 25
Get it on Google Play
Get it on Apple App Store

"Joaquim Macedo" wrote in message news:522593@forums.embarcadero.com...
>
> I'm thinking on using Firebird or Microsoft SQL Server Express - I want a 
> free database - to create a database application.
>
> How do I connect the database from Delphi XE2?
> I was looking on the Tool Palette, and I've found "dbExpress" and "dbGo" 
> ( I think that this last one if for ADO connection ... ).
>
> What is the diference between "dbExpress" and an ADO connection? What is 
> the best?

For MS SQL Server, I would personally advise to use the ADO (dbGo) 
components (specifically TADODataset and TADOCommand), although dbExpress 
can also be used. While the underlying dataset functionality is common (same 
dataset ancestor class), there is quite a difference in how they are used, 
especially if you intend to use data-aware controls.

> Do I need third-party components to connect to Firebird or Microsoft SQL 
> Server Express, from Delphi XE2?

At this point in time you will find the IBExpress components still work 
quite well with Firebird but with the clear caveat that they are not tested 
with Firebird and expressly do not promise any continued compatibility. 
Firebird and Interbase diverge a bit more in features and functionality with 
each release.

DbExpress also includes drivers for Firebird, or you can use 3rd party 
components.

-- 
Wayne Niddery (TeamB)
"If there is any principle of the Constitution that more imperatively calls 
for attachment than any other it is the principle of free thought, not free 
thought for those who agree with us but freedom for the thought that we 
hate." - Oliver Wendell Holmes
0
Wayne
11/18/2012 3:37:35 PM
Wayne,

Thanks for your reply!

Best regards,
Joaquim.
0
Joaquim
11/20/2012 3:13:39 PM
Hello Joaquim,
  Firebird is a great database and is completely free, which may be relevant 
to you. Remember that MS SQL Server Lite is free but can not be used for 
commercial applications whereas Firebird can.

The main choice for you will be whether you need the database to be completely 
free and then what you might want to do in future e.g. could you need to 
develop for MS SQL Server in addition to others, or for Firebird plus others. 
I use both the ADO and the dbExpress routes for different databases and don't 
find much difference in one relative to the other, at least not for the sizes 
of database I have been using.

To connect to your database, drop a TSQLConnection (for dbExpress) or TADOConnection 
(for dbGo, which is the ADO option in XE2) onto your datamodule, make appropriate 
values and you are ready to go with tables and queries. I would guess that 
you might have started out previously with some desktop database experience 
in which case you may want to check out some of what has been published on 
the web about clientsatasets. For client/server databases you will want to 
use these a lot.

To connect to a query, drop a TSQLQuery or TADOQuery (or you could use the 
...Dataset equivalents), add a TDataSetProvider and point it to the query. 
Add a TClientDataSet and point it to the TDataSetProvider and add a TDataSource 
and point it to the TClientDataSet. Make all other necessary chnages, add 
the query text to the T..Query and you are ready to go. If using parameterised 
queries you need to close the query to change the SQL text and specify values 
for the parameters, then close and open the ClientDataSet. If you don't use 
parameterised queries you just need to open the ClientDataset and you data 
will be ready for you to use in computations or to dispay in grids, graphs, 
etc.

Good luck, it is really quite easy.

Bruce


> Hi all!
> 
> I'm thinking on using Firebird or Microsoft SQL Server Express - I
> want a free database - to create a database application.
> 
> How do I connect the database from Delphi XE2?
> I was looking on the Tool Palette, and I've found "dbExpress" and
> "dbGo" ( I think that this last one if for ADO connection ... ).
> What is the diference between "dbExpress" and an ADO connection? What
> is the best?
> 
> Do I need third-party components to connect to Firebird or Microsoft
> SQL Server Express, from Delphi XE2?
> 
> Thanks a lot in advance.
> 
> Best regards,
> Joaquim.
> Edited by: Joaquim Macedo on Nov 17, 2012 4:06 PM
>
0
Bruce
11/20/2012 6:09:44 PM
"Bruce Eglington" <bruce.eglington@usask.ca> wrote in message 
news:523479@forums.embarcadero.com...

> Remember that MS SQL Server Lite is free but can not be used for
> commercial applications whereas Firebird can.

Do you have any source for that claim ("non-commercial only")?
http://www.microsoft.com/sqlserver/en/us/editions/2012-editions/express.aspx
0
Uffe
11/21/2012 7:31:15 AM
Bruce Eglington wrote:

> Remember that MS SQL Server Lite is free but can not be used for 
> commercial application

Yes it can, but it have some limitations that I prefer to use Firebird
if the customer allows.


Cesar Romero
0
Cesar
11/21/2012 4:05:41 PM
Reply:

Similar Artilces:

Delphi XE2 database connection demo?
hello, I have just come across Delphi XE2 for IOS mobile development, and i wanted to know if there are any examples to connect to mysql database on the cloud? This i example if for SQLite (http://blogs.devart.com/dac/index.php/how-to-develop-ios-database-applications-in-delphi-xe2-using-devart-data-access-components.html) i tried searching on the net but i could not find any example can any tell me where can i get some examples for using mysql(cloud) with Ios? Le 07/12/12 09:59, Presley Dias a écrit : > I have just come across Delphi XE2 for IOS mobile development, and i w...

Delphi XE2
friends, Is there any way to fix the delphi connecting to the database only through IPv4, I am using the component of Devart ODAC. thank you Daniel Junior wrote: > friends, > > Is there any way to fix the delphi connecting to the database only through IPv4, I am using the component of Devart ODAC. > > thank you > If you a driver from Devart, you should contact them. Perhaps someone else here has used it though. ...

Database Connection???How to connect a Database in an other server?
How to connect a Database(.mdb) in an other server? Can I use the connection string like below? mycon.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=http://www.****.com/***/mydb.mdb" You can not. That simple. Access is file based. No a client/server architecture.Thomas TomiczekPowerNodes ApS(Microsoft MVP C#/.NET)---Building a Website? Try the PowerNodes CMS - http://www.powernodes.com/ Correction: you can. Just make sure you can reach the acces db file - through a file share that is bound as drive. Not that you should. Performance will be horrible.Thomas TomiczekPowerNodes ApS(Microsoft MVP C#/.NET)---Building a Website? Try the PowerNodes CMS - http://www.powernodes.com/ To clarify, you should use the UNC name (\\server\share\path\filename.mdb) since a mapped drive for your user account will not be mapped for the ASPNET account. And as Thona says, performance will be terrible. Just as important, since you need to have access to the drive at a file-share level, it will not work through most firewalls, so connecting to a server across the Web will generally not work.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog...

Delphi XE2 Database Form Wizard
Old Delphi used to have a Database Form Wizard, based on BDE, Delphi XE2 doesn't have any. Is there any plug-in that would create forms based on the data source component ? Gilbert Padilla wrote: > Old Delphi used to have a Database Form Wizard, based on BDE, Delphi > XE2 doesn't have any. Is there any plug-in that would create forms > based on the data source component ? You can drag items from the Data Explorer view to a form or frame design surface, as far as I remember. Cannot test that at the moment, the PC i'm using has no database engine installed ye...

Database Connectivity in Delphi Pro Version
Can someone clarify what DB I can connect to out of the box with Delphi Pro (Legally that is)? I think I have been headed down a wrong path for a while, I was under the impression the DB drivers were only included with the pro version for development only. Now it is my understanding that I can connect to Embedded SQL Lite on a local PC but not via a server. Is this correct? What DBs can I connect to on a local PC using native Delphi drivers? And am I allowed to deploy an application that uses a DB on a DB server? Thanks Tim C. "tim crouse" wrote in message news:5881...

Good (Free) Database Choice For Simple Local Database For Delphi 2009
For years I have used the BDE and dVolga ( no longer abailable ) but want to learn how to use other third-party and/or Delphi 2009 vcl components for simple databases. For a simple local database with only one table and 6-8 string fields with graphic field support for one field what is a good choice? What is available to do this without buying anything or possibly with a freeware component? Should I use DBExpress? Is a commercial database application necessary to create the database? Is something available from Microsoft as a free download to create and possibly edit a...

Access to legacy (Delphi 4) Midas server from Delphi XE2 [Edit]
Hello, My company biggest product is developped with Delphi 4 and uses several Midas servers. It's a really big application (still in evolution, since 1997) , that has been started with Delphi 3. A partial or complete rewrite of this application is planned in a mid term future, and I must study if we can envisage a soft migration of some parts of the software on Delphi XE2 (or XE4), or if a complete rewrite even of the servers parts is required. If a complete rewrite must be done, my boss doesn't exclude to study the possibility of using another development environment to rewri...

mysql database, delphi 2010 and connection charset
Hi. I want to write an application which will use a MySQL database. I made a basci connection and queries. Everything is ok, except viewing data from database on a website generated with php. I'm polish and using my national letters and this is problem. When i add text into database in my app written in delphi and then view it in app, everything is ok, national letter are correct. But, when i want to view this data on a website i see strange things where were national letters. Fields in database are defined i n UTF-8, website uses UTF too. I can see on website data added from delphi on...

Connecting to a MS Access database in Delphi XE5?
Does anyone have a simple code example for connecting to an Access database from a VCL Forms application using XE5? Originally, we used the dbExpress Open ODBC driver in XE2 but that no longer works. The DbxXXDrv unit references Dbx34Drv, which in turn references DBXMetaDataCommand, which does not exist in my XE5 Enterprise install. So I thought I'd try FireDAC, as there is Connect to Microsoft Access Database (FireDAC) topic in the docwiki. I dropped a TFDPhysMSAccessDriverLink onto a form, set the DriverID to MSAcc and the ODBCDriver to MS Access (*.mdb), but could not find the Database or Password properties. Do they need to be specified in the ODBCAdvanced property? > {quote:title=Richard Goodwin wrote:}{quote} > Does anyone have a simple code example for connecting to an Access database from a VCL Forms application using XE5? > > Originally, we used the dbExpress Open ODBC driver in XE2 but that no longer works. The DbxXXDrv unit references Dbx34Drv, which in turn references DBXMetaDataCommand, which does not exist in my XE5 Enterprise install. > > So I thought I'd try FireDAC, as there is Connect to Microsoft Access Database (FireDAC) topic in the docwiki. I dropped a TFDPhysMSAccessDriverLink onto a form, set the DriverID to MSAcc and the ODBCDriver to MS Access (*.mdb), but could not find the Database or Password properties. Do they need to be specified in the ODBCAdvanced property? I resolved the Open ODBC driver issue by r...

Connection String for ADO Database in delphi prism
Hi, I want to connect to a database with ADO and aspx. from VB code what is the equivalent in delphi prism ? .... Dim MyReader as sqldatareader Dim MyConnection as sqlconnection = new sqlconnection() myConnection.connectionstring = configurationmanager.connectionstrings("DSN_MYDB").connectionstring Dim mycommand as sqlcommand = new sqlcommand() mycommand.commandtext="select * from mytable" mycommand.commandtype = commandtype.text mycommand.connection = myconnection mycommand.connection.open() Myreader=mycommand.executereader(commandbehavior.closeconnec...

Open client app with Delphi
I am very new to SQL Anywhere and to client server in general. I am developing an app in delphi which has a native driver for Sybase SQL Anywhere. I have created a database file with some tables in it but when I try to connect to it I get this error: 'vendor initialization failed'. Does anyone know what is wrong? I think it has something to do with configuring the interfaces file. I installed the 'personal server' option to my pc when I installed SQL Anywhere as I can't put it on the server yet as we are currently in the process of setting up a new server. The...

which database does the database refer in "Not connected to a database" of the second paragraph
I. 01/01 02:30:40. Synchronization Started I. 01/01 02:30:40. Adaptive Server Anywhere MobiLink Synchronization Version 8.0.2.4258 I. 01/01 02:30:40. I. 01/01 02:30:40. Copyright _ 1989-2002 Sybase, Inc. Portions Copyright _ 2002, iAnywhere Solutions, Inc. I. 01/01 02:30:40. All rights reserved. All unpublished rights reserved. I. 01/01 02:30:40. I. 01/01 02:30:40. This software contains confidential and trade secret information of I. 01/01 02:30:40. iAnywhere Solutions, Inc. Use, duplication or disclosure of the software and documentation I. ...

Delphi 7 to Delphi XE2
Hi, Still using that old workhorse, Delphi7, but am going to the conference in London hosted by Embarcadero on Delphi XE2. Although I would like to "move with the times" and am keen to get the UNICODE and 64-bit support offered by the latest IDEs, I confess to being more than a little scared about all the UNICODE/String/AnsiString and 32/64 bit issues I'm probably going to fall over. Anyone recently upgraded from Delphi7 to one of the latest Delphi IDEs? Thanks, Alain On 03/02/2012 08:55, Alain Dekker wrote: > Still using that old workhorse, Delphi7, but am going to the conference in > London hosted by Embarcadero on Delphi XE2. > > Although I would like to "move with the times" and am keen to get the > UNICODE and 64-bit support offered by the latest IDEs, I confess to being > more than a little scared about all the UNICODE/String/AnsiString and 32/64 > bit issues I'm probably going to fall over. Anyone recently upgraded from > Delphi7 to one of the latest Delphi IDEs? I recently upgraded a sizeable (Paradox) app from D3 to XE2 and was pleasantly surprised. About 20-30 hours once I understood how XE2 works. Andrew -- Andrew Gabb email: agabb@tpgi.com.au Adelaide, South Australia phone: +61 8 8342-1021 ----- Recently moved a lexicographic application from D2007 to XE2 with little pain. As you would imagine, it is heavily string-based, with much use of TStringLists, cuttin...

SqlConnection not connect to database in Delphi XE 2(mysql).
SqlConnection not connect to database in Delphi XE 2(mysql). Note: The machine was installed with Delphi 2007. error: First chance exception at $7576D36F. Exception class TDBXError with message 'DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of the wrong version, or the driver may be missing from the system path.'. Process Project6.exe (5732) Help? Aldnet Brasil wrote: > SqlConnection not connect to database in Delphi XE 2(mysql). > Note: The machine was installed with Delphi 2007. > error: > First...

UNAVAILABLE DATABASE, DELPHI XE5, IBLITE/TOGO [Edit]
XE3 INTERBASE IB2GO and IBLITE are registered and in License file, Server is running, and after setting the SQLConnection1 database to the local path and gdB file from the samples folder, when connected is set to true, get UNAVAIL DATABASE. gddemos.bdg does exist and of course can open fine with IB Console. userid and password are set to defaults. Does anybody know what is going on? Thanks for any ideas. Joe Edited by: Joe Henshaw Jr on Sep 20, 2014 2:49 PM never mind, looks like parameter for database wasn't correct for local db. Thanks anyways. never mind, looks li...

SEPA components for Delphi with Source Code (Delphi 5
Hi all, in the european union change next year the Bankingformat to the SEPA Format. All peoples and companies must change the bankingssoftware and the costumer data form acountnummers in the new IBAN and BIC numbers. See: http://www.arma-it.de/shop/artikelueber.php?wgruppeid=211&wgruppe_offen=211 Functions: - generate SEPA XML'S - Calc IBAN - BIC Database (DE,AT and CH) Questions: vertrieb@arma-it.de PS: Bankinssoftware for Develpoers (Germany only) http://www.arma-it.de/shop/artikelueber.php?wgruppeid=212&wgruppe_offen=212 El 26/10/13 21:38, A...

How do to connect database server with Delphi 7 and ASA dbexpress driver.
Hi. How do to connect database server? I used Borland Delphi, version 7 with driver dbExpress and ASA version 9. I only Connected in localhost. thank you It's been a while, but I believe there is a ConnectString property in the ASA dbExpress connection object. You can set the ConnectionString property when you develop your application using the IDE, or you can set it in code. Your ConnectionString can either be something like: uid=xxx;pwd=xxx;dsn=odbc_dsn_name or uid=xxx;pwd=xxx;links=tcpip(host=xxx.xxx.xxx.xxx);eng=xxxxxx In the first case, your ODBC DSN ...

Webinar Wednesday
Embarcadero Webinar: Mastering Database Application Development with Delphi Join Embarcadero on Wednesday, April 14 for a free, one-hour webinar and learn about Delphi tools that support a wide-array of databases (Oracle®, Microsoft® SQL Server®, MySQL®, DB2, Embarcadero® InterBase® SMP, Firebird®, Sybase® ) to help developers get their job done faster and easier. Join Delphi® product manager Michael Rozlog for a live technical session and learn: + the basics of database interactions with Delphi + the various database access libraries incl...

How can I change my connection to a different database...it is not connecting to the database I created.
My data is connected to the ASPNETDB.MDF database. Is this a must that I have it connected to this database or can I have it connected to a database that I created. You can connect to different database such as sql or other access files. All you have to do is to define which connection string to use within your web.config file. If you want to make sure that your database is prepared to be used, use features such as ASPNET_REGSQL.EXE at VS Command Prompt. Hope this helps. Jae.jae.lee@jaeleeandco.com I'm in the Army...here in Georgia. Is it cold there.. Hi Jae,    &nb...

CREATE DATABASE permission denied in database 'master'. Error while connecting to SQL Express edition
CREATE DATABASE permission denied in database 'master'.An attempt to attach an auto-named database for file C:\Domains\premrana.com\wwwroot\App_Data\personal.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. This is the error we get while connecting to the SQLExpress server. Any suggestions, hint, etc. would helpThanksSnehal Rana  The error message is saying that the database is already attached.  Since you are using iis instead of the built in web host you are going to have to go into IIS manager and stop the website so the database can detach itself from sql express and restart it before you run the websiteSilverlight-helpVb TipsSpace Coast .Net User Group You can also right click on the database in the solution explorer and select detach before running itSilverlight-helpVb TipsSpace Coast .Net User Group Hi Ken,We can run this site locally, but cannot run it while running SQL Express edition on the remote server. Here is what we get:http://www.premrana.comThanks for your tip though.Snehal Rana  You are going to have to contact your web host and see if they can give you the required permissions.  Silverlight-helpVb TipsSpace Coast .Net User Group We are running this on Dedicated server and have root access to the server. Add the MachineName\Asp.Net user to sqlexpressSilverlight-helpVb TipsSpace Coast .Net User Group ccc...

ANN: Accuracer v.10.00, embedded Delphi database [Edit]
AidAim Software is pleased to announce Accuracer VCL v.10.00. Delphi and C++ Builder XE6 (32-bit and 64-bit Windows) support added. If you already have a registered version and wisht to upgrade, you can contact our Sales Department: http://aidaim.com/help_osticket You can download a trial version here: http://aidaim.com/products/download.php Accuracer is reliable high performance embedded Delphi database with wide functionality: http://aidaim.com/client-server_database_single-file_database_delphi_database_embedded_database.htm Accuracer has most wide set of SQL functi...

"unavailable database" fishFacts demo not running Delphi 2010 Enterprise [Edit]
I tried making an Alias but not sure what name should be? It is a gdb dbDemos.gdb file in C:\Program Files\Common Files\CodeGear Shared\Data\dbdemos.gdb I tried starting 2009 Interbase server But that did not seem to help. Strange to be having such problems.Debugger does not seem to give helpful answer. Any help is appreciated Richard PS it would be nice to see youtube clip on how to make a a report with a database grid and how to print it. Also nice to see a video on how to make an installation disk for a database project? Or is Inno Setup the best option for this ? ...

Delphi XE2/XE3 Can't connect a TSQLConnection from secondary threads [Edit]
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_78da1.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" I'm porting code from D2009 to XE3 (just verified the same applies to XE2). In XE3, I just found out that if I create a TSQLConnection and connect to a MSSQL database from a thread that is not the main thread, it will give me the infamous "DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of the wrong...

Delphi XE2/XE3 Can't connect a TSQLConnection from secondary threads [Edit]
I'm porting code from D2009 to Delphi XE3 (just verified the same applies to XE2). In XE3, I just found out that if I create a TSQLConnection and connect to a MSSQL database from a thread that is not the main thread, it will give me the infamous "DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of the wrong version, or the driver may be missing from the system path." message. If I run exactly the same code from the main thread, all is fine. This is a sample code, in this case with just a button on a form, nothing fanc...

Web resources about - How To Connect to a Database from Delphi XE2? ( newbie ) [Edit] - embarcadero.delphi.database

Database - Wikipedia, the free encyclopedia
A database is an organized collection of data . The data are typically organized to model aspects of reality in a way that supports processes ...

Database - Wikipedia, the free encyclopedia
... requiring information. For example, modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies. Database ...

Dodgy database exposes details of 191 million US voters
... years, there's a high chance that your personal details are now out in the wild. Security researcher Chris Vickery found a misconfigured database ...

Huge database of 191 million U.S. voters found on the open Internet
... such bulk information online, a recent discovery seems to indicate. According to VentureBeat , a security researcher found the exposed database ...

3.3 million Hello Kitty fans' details have been exposed in a huge database leak
... week after week, the hacks, breaches and data leaks continue to roll in. The latest victim? Hello Kitty. CSO Online is reporting that a database ...

Massive Voter Database Left Open For Public Consumption
Gosh, we could have avoided all the angst about the Clinton/Sanders voter database breach if only we'd known about this major database , accessible ...

Database configuration issues expose 191 million voter records
A misconfigured database has led to the disclosure of 191 million voter records. The database, discovered by researcher Chris Vickery, doesn't ...

Database error publishes data of 3 million Hello Kitty fans
Online researcher Chris Vickery uncovered a database this weekend containing the personal information of 3.3 million accounts associated with ...

191 Million US Voter Registration Records Leaked In Mystery Database
A huge database of 191 million US citizens is uncovered. But no one knows who carelessly left it open, whilst the FBI have been contacted.

3.3 Million Hello Kitty Accounts Exposed In Database Hack
A database for the Hello Kitty community sanriotown.com containing 3.3 million accounts has been discovered online in an apparent breach. Read ...

Resources last updated: 1/5/2016 11:41:25 PM