Connecting to ADO is hard from installation in Delphi, so I decided to use VBscript, which I have never used before. VBscript has little support in Delphi, so how do I run a Windows script editor to get support and carry it over to Delphi? I do not understand the statements in VB script very well yet
My Delphi TTable is connecting to
the ADO
I need to connect to a
Microsoft DB file in c:\program
files\common\my folder\my file
I need to disconnect the ADO to
relocate this file and place a new
copy in its place periodically.
I looked up the MSN web site and it's not that helpful.
I see scripts that could be useful for many things if I can get them working.
Can anyone help please?
Lex Dean
The best way is to use the native (and easy) ADO components in Delphi.
You will found a example of 'how to do', with source, here :
http://sourceforge.net/projects/axbase/
You do not connect to ADO. You connect to a DB through ADO. ADO is a technology to connect to different databases using a common API - the database native API is taken care of by ADO drivers.
You say you need to connect to a "Microsoft DB" file but do not specify what kind. ADO can connect directly to Access files, but if you use SQL Server you never connect to a file, you connect to the database server.
Delphi has a different set of components to connect through ADO. They are the TADOxxxx component. TTable is built upon the BDE, and can't use ADO. Use TADODataset or TADOTable.
Using VBScript from Delphi is possible, but would not solve your problem easily - you will have to pass ADO objects to and from Delphi and VBScript, and it requires a good knowledge of Delphi, Windows, COM and so on. If you need to use ADO, take the straight path.
Related
I have an application I developed for PC using the TsqlConnection Component The driver is set to MySQL and runs great when the driver dll's are present. I wanted to make a client for Android Using Delphi XE5. I again used TsqlConnection and when I select mySql for the Driver property it adds Data.DBXMySQL To my USES section but the compiler tells me "Cannot Resolve Unit Name"... Is this .pas not in delphi's library, or am I missing something else? Also I'm fairly certain that I'll need some kind of lib file like the DLL's I used in my pc application. Please do not suggest I use another component (that won't solve my issue or better my understanding) thanks!
I have installed ZEOS on my Delphi 7 and tried connecting to a Firebird database. After I put the db path to the object inspector and tried to connect to it, Delphi always displays a message requested database driver not found. I have installed the Firebird ODBC and have set the setting on the data sources shortcut found on administrative tools but still can't connect.
How do I install the driver and where do I need to put it?
I used this connection when i tried connecting to my Firebird database
procedure TForm1.ZConnection1AfterConnect(Sender: TObject);
begin
end;
I think you might be misunderstanding what Zeos is and does. It is not a layer that lies between your application and ODBC, ADO or whatever database access layer. Instead, it is a database access layer itself that allows you to connect natively to several databases like Firebird, SQLite and others. It does not need ODBC to be installed.
You can find an introduction to Zeos architecture at their webpage in this article.
In order to connect with Firebird you will need to use a TZConnection and set following properties:
Database: For example c:/myapp/mydatabase.fdb
Hostname: localhost if the same computer.
Protocol: Should be one of the Firebird protocols. Firebird-x.x stands for protocol to access "normal" Firebird, while Firebirdd-x.x is for the embedded version.
User
Password
You can set additional properties but for a basic connection that should do it.
Regarding the error you mention, I suspect you are trying to use the embedded version. In that case, make sure the DLL mentiones by #Mark is in the same path as the app executable. If it is a regular Firebird installation make sure its path is included in the system path.
HTH
I would like to know if there are any open source components available for Delphi XE-2 that can connect to postgreSQL other than using outdated techniques like ODBC.
For now just Win32 support is needed, but if Win64 and OS-X support is also available that would be a bonus.
I googled around a bit, but the only lib that's available (ZEOS) looks like it is no longer in active development.
There does seem to be a patch for Delphi XE2 but I could not get it to compile.
As of right now: No.
You either route through ADO -> ODBC, dbExpress -> ODBC (for XE2*, see below), hope to make Zeos work, or pay for one of the various commercial components (PostgresDAC, DevArt, or AnyDAC, to name a few).
While Delphi XE2 comes with an ODBC driver for dbExpress, it's only for the Enterprise SKU and higher -- it's not available in Pro. For XE2 Pro users and users of older versions of Delphi there's Open dbExpress. I've tried using it before, but always had trouble with it. It's been updated since I've last used it though, so maybe whatever problems I had (which may have been my own fault) aren't an issue anymore.
All this said, ODBC isn't really an outdated technology. On non-Windows systems it seems to be the preferred DB-agnostic API. That said, it seems that many environments prefer to implement their own connectivity (e.g. QT, GNOME) rather than relying on ODBC exclusively. However, for the PostgreSQL project itself, their default (and best supported) connectivity API is ODBC.
Update: In fact, Microsoft is making ODBC their premier connectivity API for SQL Server starting with SQL Server 2002 (codenamed Denali). See: Microsoft Aligning with ODBC and Microsoft is Aligning with ODBC for Native Relational Data Access. This is the last release that will support OLE DB, and Microsoft is encouraging developers to use ODBC.
Turns out you can get ZEOS to work on Delphi XE2 and as far as I've tested all DB functionality works.
Here are the steps to follow:
Use SVN* to download the Delphi XE2 archive for ZEOS at:
https://zeoslib.svn.sourceforge.net/svnroot/zeoslib/branches/testing
Put the zeos folder in the appropriate place, I'm assuming c:\borland
Do not open Delphi yet, but instead open
C:\borland\zeos\packages\delphi16\ZComponent.dpk in wordpad and remove the trailing {$IFDEF} (remember to keep the ; in place).
Open c:\borland\zeos\packages\delphi16\ZeosDbo.groupproj.
Choose build all
Open c:\borland\zeos\packages\delphi16\build in explorer, copy all .bpl files and copy those to c:\borland\delphixe2\bin
Component -> install packages -> [add...] and choose
c:\borland\delphixe2\bin\ZComponentDesign.bpl
as a SVN client I've downloaded SVN-tortoise from: http://tortoisesvn.net/downloads.html
Combined with both the SVN plug-ins for Firefox
I would like to know if it's possible to read a .mdb file without the use of ODBC.
I need to write a Delphi application that reads 2 columns from a mdb file and writes those columns in a postgreSQL database.
Is there a trick, Delphi component or method that I can use that does not depend on ODBC.
(For some reason ODBC on my devel-laptop is broken).
If need be I can also use Delphi 2007, and I even have a version of Delphi 1,2 and 3 somewhere as well.
You can use ADODB. It is part of Delphi 2007, at least. It does not depend on ODBC or BDE: it uses OleDB/ADO instead.
long long ago, there was Data Access Objects DAO, but it appears that these are deprecated (all the way at the bottom). Still, with a bit of luck you could still find documentation for it and use it.
My project is on Delphi 2009, Paradox DB and Google Maps. The code is OK and the time right now is to build the project. This is the first time to do it. As I know there are two programs to create the setup file; InstallShield or InstallAware. Via InstallAware I did my first test but its fail and the problem is the DB, I could not run it after the setup. How can I make the DB work in setup file.
In my delphi project there is two part for DB connections;
the first one with; Query1--->DataScore1
the second one; Table1--->Datascore2
the root of delphi files is "Desktop\ttelekom\ttelekom.exe
the root of DB files is "C:\Program Files\Common Files\CodeGear Shared\Data\databasettelekom.db"
Here the picture of Delphi main form;
http://img267.imageshack.us/img267/5333/77714402.png
Thanks for all.
How are you accessing the database? If it's using the BDE, you have to install the BDE. There's a merge module you can add to your installation, by default in %CommonProgramFiles%\Borland Shared\BDE\ - read the bdedeploy.txt file you'll find there, along with bdeinst.txt.
If you're using another way to access the Paradox files (for instance, ODBC), you'll have to configure that instead.
asilloo, when you said "..As I know there are two programs to create the setup file.." that is not true, exist many options to create installers like wise, nsis, Inno-setup.
for you specific task i will you recommend Inno-setup, because is freeware, reliable, easy to learn and the script language used to create the installers is delphi.
to deploy your application do you need install the bde in client machine. check this sample using inno-setup.
Inno Setup Knowledge Base - HOWTO: Deploy BDE (Borland Database Engine)