• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

Delphi Website options

I have acquired a Windows 2003 Virtual private Server from 1and1. I have installed mySQL 5.1 and I have Delphi 2007.

My question is: can someone provide simple, step by step instructions to setting up a simple Intraweb app which accesses the mySQL DB. i.e. do I have to configure IIS, where do I put the output file (exe or dll) from Delphi, how do I point my domains at my VPS?


3 Solutions
I'm not going to be much help, but some comments...

Is this a linux or windows server (by IIS I assume it's windows)?
If Linux, what flavour?
To point your domains to your VPS, you should get the IP address of your VPS (which should be static) and ask whoever you registered your domain with, to set the name servers to the IP address of your VPS.
If your IP address isn't static (and you shouldn't have taken a VPS if it isn't static) then there is a service called DynDNS.org , you get something to run on your server, which polls its IP address every X minutes, and as soon as it detects a change, it informs that DYNDNS.org database of the new IP address...
then you can use as your domain something like example.dyndns.org
WeeStinkerAuthor Commented:
It is a Windows server so that I can run Delphi web apps on it.

WeeStinkerAuthor Commented:
I think the domains are pointing to the correct (static) IP of the VPS.

How do I do something as simple as displaying a home page?  do I put a file called index.htm in the c:\inetpub folder ?

Apologies for my ignorance.
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Hmmm okay well like I said I can't help much cos it's not exactly my area,
but i know that in IIS you create a default website, and then a default webpage (e.g. index.html), and then when you access your domain, i.e. www.example.com, the DNS servers forward you to the IP address of yor VPS, your browser then connects to that IP address using port 80 (the port for HTTP), your server will have that port open, and will go to your default website and load your default webpage.
If you had to then, for example, create another website under the folder "example", then if you go to example.com/example it would then go to that website and not the other.
That's my understanding. Hope this helps
Check out this question, it covers a very similar question and should cover most of the basics for you.


After reviewing that, and the links to the Intraweb documentation and overview for deployment options, we can visit any follow-up / remaining questions and clarify anything else for you.
IntraWeb apps are very simple to deploy.
1. Firstly (assuming the server is running windows), create your intraweb app in application mode (.exe) and run the app on your server.
2. You do not need to configure IIS in order to use an intraweb app unless you are creating your app as a .dll
3. in order to use MySQL in your intraweb app, you go about it the same way as a normal delphi app wich isnt as straight forward as i could be (see below)

Basically, there are two ways of accessing a MySQL database from a
Delphi application: using an ODBC driver or the libmysql.dll library (wich i will not cover as ODBC is better)


In the MySQL web site you can find the MySQL ODBC driver for Windows:


After installing this driver you can use the BDE Data Access components
or the ADO components to access tables or to perform queries on a MySQL

To use ODBC, first you should create a DSN using the ODBC Data Sources
applet of the Control Panel. For example, I created a DSN named
MySQL_Test and configured it to log in as 'root' in the MySQL server
located at 'localhost' (you can connect to a remote server using its IP
address or its domain name) and open the 'mysql' database.

In a Delphi program you would have to use a TDatabase component if you
don't want the BDE to show the standard login prompt. You have to set
minimally the following properties:

    AliasName = 'MySQL_Test'
    DatabaseName = 'MySQL_Test'
    LoginPrompt = False

In a TTable or TQuery component you have to set the DatabaseName
property to 'MySQL_Test' and that would be it.

The advantage of using ODBC is that you can use the standard Borland
Datasets, and the disadvantage is that you have to go thru two layers to
get to the MySQL server (the BDE and the ODBC driver), although it must
be said that even with ODBC, MySQL is still faster than other database

WeeStinkerAuthor Commented:
Thanks. IrishBuddha, it's great to know that you'll be able to handle more detailed IntraWeb questions.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now