Author Archives: Jenaro Centeno

About Jenaro Centeno

My name is Jenaro Centeno. I’ve been working in the programming area since 1990, at that time in DOS environments, after that on the Windows platform. A few years ago, I meet the Delphi Language, and in that moment I said “What the hell I was doing without this?”. And then the adventure started. More About Me Here.

Accessing Databases (Main Article)

This demo will be divided in a Server and a Client.

Basically, we are going to be serving several queries to the clients from a server. To accomplish this, we will be using a database created with SQLite. SQLite is an awesome SQL Server embedded that can be easily used in Delphi. To make the connection to the database we are going to use ZeosDB components, they are open source and stable. For all the communication, of course, we will be using RTC SDK components.

So, let’s go ahead. Choose your destiny:

  1. The Server.
  2. The Client.

Accessing Databases (Server side)

The Server.

This demo will show how really simple is to create a server that can send the content of tables in a database to a client.

Steps.

  1. Create a new project in Delphi 7
  2. Create a DataModule to connect to Database and send responses back to the client
  3. Create a Form to control the Server.
  4. Compile and run the Server. Continue reading

Accessing Databases (Client side)

The Client

This is the article for the client in the Accessing Databases article. At this moment, we have our Server ready, so now it’s time to create the Client that will ask for the data. In this case, this client is really simple, in fact, as simple as it could be. This Client will call a function on the Server and get back the content of the table tbl_products in our Server’s database.

Steps.

  1. Create a form for the Client with the needed components.
  2. Write the code to  call the Remote Function. Continue reading

Write your first Remote Function (Lesson 5)

In this lesson, we’ll be building a solution with a Server and a Client. This first lesson with a Client side made with RealThinClient Components is simple but shows the concept behind a client – server system that could be the base for a larger application. We’ll be using Remote Functions to accomplish this task.

This Post has three sections.

  1. The Server.
  2. The Client.
  3. Make it work.

Continue reading

Send large files from a Server (Lesson 4)

This demo continues over Demo 3 (Sending small files). Now, we are going to make a webserver that is able to send files no matter their size.

We must be careful with our server’s memory, we may have a really big file in our server and we don’t want to use all of it.

At our first two examples we have been sending all of our content at once on the OnCheckRequest and OnDataReceived events of our RtcDataProvider components.

Continue reading

Send small files from a Server (Lesson 3)

By this moment, we have been sending content generated by our Server. Now we are going to see how to send small files from a folder that resides inside our Server’s running directory. We’ll do it this way because with this approach we can control what files can be accessed from the Server.

We’ll use some functions to secure our Server and check that the content (file size in this case) is small enough to send.

In the next lesson we’ll see how to deal with bigger file sizes.

We’ll need the code of our Lesson 2b post which you can download at Code For RealThinClient SDK Lesson 2b. Continue reading

Server using Query parameters (Lesson 2b)

Now that we have seen how to Create a Web Server and how to Send Dynamically Generated Content, we are going to see how to accept Query Parameters.

We are going to make some small changes to our previous code (Code for Demo Sending Dynamically Generated Content) to accept request’s query parameters.

When we coded our Dynamically Generated Content we give no option to the user to decide what Square values the system will return, so now, we are going to give the user the choice to:

  1. Select the starting number of the Square values.
  2. Select the ending number of the Square values.

Continue reading

Server sending dynamically generated content (Lesson 2)

Now we’re going to create an application to send Dynamically Generated Content. We’ll use as base the RealThinClient SDK – Your First Web Server  project. You can download the source code to work with.

In this lesson, you’ll see how two data providers can work together and how you can use multiple Write calls to send complex content out. Continue reading

Your first Web Server (Lesson 1)

We’re going to build a Web Server with RealThinClient SDK in Delphi.

Basically we are going to:

  • Create a Project
  • Add two RealThinClient SDK components (RtcHTTPServer and RtcDataProvider)
  • Configure three events.
  • Check that our Web Server is working.

We’ll be working the code sections in two formats, one using the with clause and another without it.

Continue reading