Old programming language and databases

A place to discuss the science of computers and programs, from algorithms to computability.

Formal proofs preferred.

Moderators: phlip, Moderators General, Prelates

User avatar
jacksmack
Posts: 83
Joined: Wed Mar 21, 2012 2:18 am UTC
Location: Italy

Old programming language and databases

Postby jacksmack » Thu May 28, 2015 11:04 am UTC

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!

Tub
Posts: 399
Joined: Wed Jul 27, 2011 3:13 pm UTC

Re: Old programming language and databases

Postby Tub » Fri May 29, 2015 9:20 am UTC

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?

User avatar
jacksmack
Posts: 83
Joined: Wed Mar 21, 2012 2:18 am UTC
Location: Italy

Re: Old programming language and databases

Postby jacksmack » Fri May 29, 2015 11:04 am UTC

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.

User avatar
WanderingLinguist
Posts: 237
Joined: Tue May 22, 2012 5:14 pm UTC
Location: Seoul
Contact:

Re: Old programming language and databases

Postby WanderingLinguist » Mon Jun 01, 2015 7:35 am UTC

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.

commodorejohn
Posts: 1113
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: Old programming language and databases

Postby commodorejohn » Tue Jun 02, 2015 5:34 pm UTC

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.)
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.


Return to “Computer Science”

Who is online

Users browsing this forum: No registered users and 5 guests