Page 1 of 1

Old programming language and databases

Posted: Thu May 28, 2015 11:04 am UTC
by jacksmack
Hi,

Please, I would to know, having an old programming language, for example Pascal, Qbasic, or GwBasic etc..., and a database like MySql or something else,
Is it possible to create a program in those languages for querying to that database?
Certainly I don't want the list of the source code of some library, but,
I would want to know, what are the various passages, the various concepts, to create that connection?

Can you give me some suggestions?
many thanks!

Re: Old programming language and databases

Posted: Fri May 29, 2015 9:20 am UTC
by Tub
Depends on the language and the effort you're willing to invest.

If the language runs on an operating system supported by your database, you might be lucky enough to be able to link against their client libraries and use them as you would in C. But AFAIK the languages you listed are all MS-DOS based, so you can't.

Lacking that, if the language has the ability to open TCP/IP connections, you could talk to the DB server directly. The network protocols are usually well documented and could in theory be reimplemented. "Reimplementing" sounds like a lot of effort - we're talking thousands of lines of code here. Even getting a tcp-stack to work on MS-DOS is non-trivial, let alone using it from an ancient language. But maybe google can find you a tutorial for the language you want to use?

Re: Old programming language and databases

Posted: Fri May 29, 2015 11:04 am UTC
by jacksmack
Many thanks for the answer.
Tub wrote:Lacking that, if the language has the ability to open TCP/IP connections, you could talk to the DB server directly. The network protocols are usually well documented and could in theory be reimplemented. "Reimplementing" sounds like a lot of effort - we're talking thousands of lines of code here. Even getting a tcp-stack to work on MS-DOS is non-trivial,

Let me say that this matter it is really interested even if it's non-trivial.
Just the fact to reimplement from scratch, yes, sounds like a lot of effort, but also, sounds like a way to comprehend better at a lower level how a program can establish a connection to a database.

So TCP/IP is the keyword to reimplementing.

Re: Old programming language and databases

Posted: Mon Jun 01, 2015 7:35 am UTC
by WanderingLinguist
Depending on how reliable you need it to be, and whether you don't mind about a solution that's a bit funky, one way would be to run the program in a DOS emulator in a host operating system that supports the database software directly. You could have the program write database requests as numbered text files into a directory shared between the emulator and the host, and have a script running on the host that monitors for request files, executes them, and writes out the response in a similarly-numbered file. Messy, and there could be locking or integrity issues that you have to deal with, but it could probably be made to work.

Re: Old programming language and databases

Posted: Tue Jun 02, 2015 5:34 pm UTC
by commodorejohn
TCP/IP on DOS really isn't that hard - the main thing is getting a packet driver for your NIC. (Proptip: archive.org has a backup of the 3COM site before HP ruined it, with drivers for damn near every ISA/PCI NIC they ever made for DOS, OS/2, Netware, Win16, and Win32.)