Web Hosting Talk







View Full Version : HTML form -> MS SQL2000 DB? (using PERL?)


nagromme
08-08-2004, 01:09 PM
I'm new to DB stuff... all I've done is very simple PERL reading/writing with comma-delimited text files. No SQL stuff.

Now's my chance to learn! I'm doing a web form that has to put the data into a database, for some folks who are already running MS SQL 2000 on their web server. (They're not married to that product--the database does not exist yet, I'm making it--but why not stick with what they've got installed?) Sounds like an FAQ, but I must not know what to search for :)

I know some very basic PERL, so PERL is my preferred method. (I know how to make PERL notify them by email when a submission is added to the DB--which we need.) And I can find documentation of SQL commands online: "Insert" should be all I need I guess.

But I'm not sure where to begin now, so any beginner advice/links/examples would be much appreciated :)

The questions I know I have:

1. Do I need any PERL modules?

2. What access/tech info do I need to request from them in order to connect?

3. To begin this, how do I create the empty table to work with? (SSH to their server and use the SQL "create" command from the terminal?)

4. What kind of tools will MS SQL 2000 give them on their end for viewing/editing the data? Will they have an easy GUI way to do so? (Not really my problem, I'm more curious--in case the way I do this might make things harder for them later.)

Then come the questions I don't know I have :)

Thanks in advance!

Kangar00
08-08-2004, 02:06 PM
Hi nagromme,

to help you with your task it would be good to know what target platform you will be using. Does the webserver run on the same machine as the MS SQL Server? What webserver will you be using (IIS, Apache, ...)?

As for connecting to MSSQL 2k as far as I know it should be possible with the DBD::Sybase module if it's built with the TDS from freetds.org which support TDS version 7.0 - Do a google to find some HOWTOs on how to build that module. I must admit that I never tried it yet with Perl, got it working though with PHP from a Linux box to a SQL2K machine with the same TDS library.

The access information you will need is the Server IP/Name, depending on the installation of MSSQL2K the instance name. You'll also need login information (username and password) - but make sure the SQL server works in compatibility mode and does accept username/pass requests in addition to Windose security contexts.

To create a table you'll need access to the command line tool "isql" to run SQL commands on the database.

MSSQL comes with a set of tools for administration like the Enterprise Manager to manage databases, users, etc. There is also the Query Analyzer to run SQL commands on databases. Enterprise Manager is easy to use GUI tool, there are more tools shipping with MSSQL, loke optimizer tools and stuffs - you might want to check the documentation.

nagromme
08-12-2004, 05:53 PM
Thanks. I'm tracking down those answers... too many people involved, one of those things :)

Meanwhile, they've also got a UNIX Webserver I've used before, running MySQL, PERL and PHP. I could just use that server, since they don't seem to care THAT much about using SQL Server.

So... what's the easiest route if I choose MySQL? PERL or PHP? (I know PERL but it wouldn't kill me to try some PHP!)

Only two things need to happen form the form (a questionnaire basically):

1. The data from the form needs to go into SOME DBMS. MySQL, SQL Server, whatever. Just so long as they can view the records.

2. A notification email needs to be sent to the people who will check the submissions. (I can do that in PERL easily.)

Thanks again.

Kangar00
08-13-2004, 08:53 AM
Both languages are apropriate for that job - choose whatever you feel more familiar with. For an easy task there is no difference in performance or stability, just make sure you use latest builds for the interpreter of your choice.