Question

database, "sort of" javascript question

Asked by: gph

I have a client that has been great.  I've done a few client side web apps and an hta for him.  Now he wants me to build something online that would require a database on the server.  I've never done anything on servers and don't know where to start.

Here are his requirements.  I need to know if they can be done and what type of server he would need to do it.

1) He has an existing excel spreadsheet that he wants to use on the server.

2) The spreadsheet is used to find a price for a given product request, there are around 30 variables that affect the price.

3)  Instead of him manually finding a price for his dealers he wants the dealers to use a web page that generates a price by their selection of the variables on the page.

Here are my questions/requirements

1) I know JavaScript and a little VBScript, I'd like to use JScript.

2) What other languages will I need to learn?

3) I assume I would collect and check user input on the client then, if it's correct, call back to the database on the server and generate a price.  Is this correct?

I realize this isn't a JavaScript question but feel you guys would be the best to guide me.  Basically what I need is a road map to pull this off.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-08-03 at 15:46:49ID20698239
Tags

javascript

,

database

Topic

JavaScript

Participating Experts
3
Points
500
Comments
25

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. GetElementbyId or tag with VBScript in HTA
    I am trying to write my first hta to allow users access to ADUC. Right now I am having trouble getting the value of a text box that will be used to search for users. I have tried all of the following with no success: document.formname.id.value document.formname.id.innertex...
  2. How To: create a link on a HTA that launches another HTA
    Hello: I'm looking for ages to do something real easy: an HTA with a link that starts another HTA. Any help would be appreciated, Leonard
  3. HTA\Vbscript question
    I have this code as a part of a larger script in a HTA: CreateObject("Wscript.Shell").Run("cscript notepad.exe c:\temp\temp.txt") The problem is, this works fine on the local machine. But if I launch this HTA from another remote machine (the HTA is hosted...
  4. Convert VBscript to HTA
    I have ported a working VBscript printer listing script to try and pickup HTA...however, after making all the changes, as best I could determine, I get 2 errors... 1 on line 77, which is blank...but I believe the error is on line 78 the function line saying a syntax error ex...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: gphPosted on 2003-08-03 at 15:50:33ID: 9063343

Also, there is no rush here.  He knows I'm a newbie at server side.  He told me to take my time and get it right.

 

by: twist_Posted on 2003-08-03 at 16:02:39ID: 9063364

1) I know JavaScript and a little VBScript, I'd like to use JScript.

On the client side use Javascript.  If you know vbscript you will best off choosing ASP as your server side language.

2) What other languages will I need to learn?

SQL and relational database theory for your database stuff.  I wouldn't bother using the excel sheet tbh I'd copy the data into tables.

3) I assume I would collect and check user input on the client then, if it's correct, call back to the database on the server and generate a price.  Is this correct?

Yes you can do that but bare in mind it is nearly always best to do data validation on the server side because client side validation requires that the user has javascript enabled (risky)

I don't have time to give a detailed answer but basically your first steps are to get an IIS web server running with ASP and SQL Server (or Access) capabilites.

Then you need to learn how ASP uses databases. Here is a good start

http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=8

 

 

by: sciwriterPosted on 2003-08-03 at 16:32:36ID: 9063422

gph --

Like twist, we all tend to suggest the standard database server at the outset, namely Access, and that's fine for a lot of data, and a general "ball park" solution for most BD needs.

However, in your client's case, I'll bet 10 to 1 that he wants to update this excel spreadsheet from day to day, and he doesn't want to be bothered rebuilding some other file from it -- namely, redo the Access database as needed -- or have you write software that will do it.  Why bother, if it is in a simple Excel spread sheet, and there are 30 or so calculations to get a price.  I't's a LOT of work to re-render that sheet into an access db, and mucho programming....

I think your solution is so simple, it might amaze you.

Forget the fact that he has his excel SS on a "server" and forget the fact that someone is pulling it from that server to a client.  It's all just UNC paths to windows and URL names to the internet, it just doesn't matter.

You've already got all the equip. you need to do the job -- VBscript, and Jscript and they are perfect for interfacing with any MS data -- that's what MS does, keep it in their family.

So you don't really need to learn anything except the basics of putting the data into an ASP file instead of HTML.

Strategy --

1.  Get a copy of the excel SS to work with (incidentally, at the outset, write your code to work with a copy of the spreadsheet, not his original file name, and be prepared to copy it to that file name each time he updates it.)  If you do not plan this step at the outset, his SS will always be locked and uneditable.  You can make a simple batch file to copy the SS from original to working copy on the server each day, no biggie.

2.  With the SS on your own system, start with VB to be able to pull the values out of the cells, since VB can get at excel data natively.  I'm not a VB type, but I've seen it done, and if you know VB, you know how to get the data.  At this stage make sure you access only the cells with final results, or else do the calculations yourself in the VB script -- if you are trying to get formula cells, you'll have difficulty debugging it.  So value cells, else do the calcs yourself.

3.  Now you have the data with VB, it's fairly easy to output it into an ASP file for people to see the fields to fill in to get the results.  With a combination of ASP and JS, you can build whatever they need to enter to get the data.  The ASP page will automatically get it from the VB functions, and you put it into the cells with JS and calculate.

4.  It's a ready-made MS marriage, as I see it.  Of course, you have to fill in the details, but people do this stuff all the time.  And the nicest part is that you can test the entire thing on your local computer.  Once it functions, you just move the SS copy and the ASP page to the server, and it is dished to the client with the needed JS to make it run, and the ASP page knows to get the data from the SS copy file, which is now located on the server.

If this all makes sense, start programming ....  It's a snap, the only devil is in the details .....

 

by: gphPosted on 2003-08-03 at 16:37:33ID: 9063431

twist_, I should have been more clear.

I can read VBS but have only written maybe 20 client side functions (hta).  I only wrote them because I couldn't figure out how to do them in JavaScript.  They were for scripting MS FrontPage 2000, all the help files are in Visual Basic.  I have since figured out how to translate them to JavaScript.  I've seen JScript questions on this forum and have assumed them to be on the server.  If at all possible I'd like to do this with JScript.

The excel sheet is tied into other spreadsheets and apps that he has been using for years.  He is talking about similair projects in the future.  He wants to stick with excel and, if I can show him how to edit on the server, he wants to make updates himself.

JS enabled isn't an issue.  His dealers all use the same CPUs.  You have to be a dealer to buy from him.

 

by: sciwriterPosted on 2003-08-03 at 16:48:25ID: 9063452

If it's a multidimensional excel SS, you might have more trouble, but I think you will need VB to do some data extractions, I'm not sure if Jscript can get them all.  But VB and ASP certainly can ....

 

by: gphPosted on 2003-08-03 at 17:00:17ID: 9063477

sciwriter what do you mean by a multidimensional SS?  Have I confused you also by saying it is "tied into other spreadsheets"?  What I ment is that it's is related to other SS he uses.  I just phoned him and asked if it was multidimensional and he said "what's multidimensional" lol.  I asked if it was stand alone and he said yes.  Is that what you mean?

 

by: sciwriterPosted on 2003-08-03 at 17:15:38ID: 9063512

Being "tied to" other spreadsheets adds extra "dimensions" in the spreadsheet world.  That means that the data which needs to be gotten may be in another SS somewhere, and in the final "master" SS, there is only the formula present, not the values.  Get it?  If you've ever seen an Excel SS with say 10-20 tabs at the bottom, each tab, if linked to the others, creates an extra "dimension" to get data from.  He is probably right now looking at a SS on screen which has several tabs at the bottom, each being a separate "SHEET" although not a separate file.

Therefore in an XLSS, you can have say 5 sheets, where the formulas are cross linked from one sheet to the next.  Don't let that scare you -- technically it is complex, but in reality, all you need with your program is to get the final RESULT of all that cross linking of values and formulas.  Therefore you MUST be sure that you are getting a result or a real value, as you can't just poll a data cell -- M47 for example -- and assume it is a result, it's likely to be a formula.

 

by: sciwriterPosted on 2003-08-03 at 17:19:52ID: 9063521

Easy solution -- call him and find out how many XLS files he is dealing with, and then ask him, "when you open each file, how many tabs do you see across the bottom?".  My guess is, he'll have a single file, with several tabs, or different tables of values and calculations.  In that case, it's easy, just copy the file to a working "web" one, and get to the cells via VB.  You MIGHT be able to do this directly with ASP -- don't forget, MS invented ASP to deliver to the client exactly the type of data you are trying to get -- live values from another MS application.  ASP is the key to much of it, although certainly not all ....

 

by: gphPosted on 2003-08-03 at 17:38:51ID: 9063554

Yes it's not tied to other SS.  He only uses other SS like labour costs and building overhead to generate data.  He then uses a calculator to come up with a final price and inputs those prices into the SS I need to deal with.  It's a ma and pa type operation, maybe once I'm done I can help him tie these SS together.  At present I'm a XL newbie also.

Having said that, this is looking better all the time.  As I said I've scripted FP with JS.  I've also scripted Word and PhotoShop.  As far as I understand it, MS programs can all be scripted with JS.  Finding JS examples seems to be the only issue but I'm not a newbie at VB - JS conversions.

Is this true?

ASP == JScript && ASP == VBS && ASP == VB

 

by: sciwriterPosted on 2003-08-03 at 17:50:11ID: 9063589

Well, ma and pa saved your butt, boy, because a spreadsheet with only final values simplifies your life about 10,000%, believe it!!

As for the == equation, I'd have to say -- more or less, yes.  Jscript can't do things VB can and ASP is different, since it is the deliver of the data, so if you write the equation this way, I think you're closer to it --

ASP +VB == ASP+ Jscript == ASP + any other MS data fetch method.  The equality is not exact (obviously), but in terms of being able to get data into the ASP page, they are somewhat equivalent.  However, you will find that some ways can get XLS data much easier than others.

1.  Start looking into getting XLS data with VB, then XLS data with Jscript, then XLS data with ASP alone.
2.  By the time you've done that research, you'll have the answer.
3.  It really is easier than yhou pictured, and you do not need a "database" server in this small, unique setting.

Cheers

Sci

 

by: sciwriterPosted on 2003-08-03 at 18:02:57ID: 9063630

P.S.  -- you should help him tie them together in the end, because XLS takes the place of a calculator.  Show him how to enter a formula in the SS to get the result.  So if you sum column F1-F20, and put that formula in the F21 cell, it calculates the total automatically.  The PROBLEM with this for instantaneous data access on a server, is that there is no window event occurring to force a result of the formula, when the request is made, therefore you only get the fomula, not the value.  So if you teach him how to do formulas, remember, for your needs, it's a LOT simpler to have a static table full of values, not formulas.  This is where VB might come in, because it can get these results easier.

However, now I think about it, with a static table (just of values) you can probably do the entire thing with just ASP, and you may need nothing else at all!!!

 

by: gphPosted on 2003-08-03 at 18:22:20ID: 9063682

Yes ma and pa are the best :)  I'll help him ties these SS together once I understand them.

Is this right?

ASP is a language onto its own.  It interacts with a given language on the server, it creates a page using the data it receives from the language then delivers the page to the browser.

 

by: wfRGBPosted on 2003-08-03 at 19:18:54ID: 9063876

1) I know JavaScript and a little VBScript, I'd like to use JScript.
-Good couse javascript is the better language. If you need it I can translate VBS  to JS for you.


2) What other languages will I need to learn?
-If you want to use sheet as datasource you must learn SQL, ASP and ADO  at a verry basic level


3) I assume I would collect and check user input on the client then, if it's correct, call back to the database on the server and generate a price.  Is this correct?
-No it's not. Never ever thrust the data sent by the client. Always validate it on the serverside.

My suggestion:
Why don't you just setup the sheet as an ODBC datasource and get the data you are after with SQL.
check the link: http://support.microsoft.com/support/kb/articles/q195/9/51.asp

 

by: sciwriterPosted on 2003-08-03 at 20:44:52ID: 9064123

SQL and ODBC means converting excel to Microsoft Access, gph, remember that ....

No ASP is "active server pages" which means it gets data from MS applications and displays them in an HTML format.  Think of it as MIcrosoft's marriage of cold fusion, html and Jscript, but BEFORE XML was a standard, hence it is weak on XML, and strong on getting data from MS files -- and this is what you have.

VB is a language unto itself, like C, but it is compiled at run time, not natively executable, like asssembly language.
VB, as it relates to web pages, is whatever features MS decided at the time were best for web pages.

I disagree that you need to learn SQL and other DB languages -- an overkill for this project.  But I will recede into the background, and let others contribute now... just holler gph, if you need more from me .....

 

by: gphPosted on 2003-08-03 at 20:51:20ID: 9064141

wfRGB, it was your answer to this question that got me hoping I could do this with JScript.

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20687007.html

I am sorry but I'm full of questions.

What is SQL and what does it do?

The link you gave me looks very useful but I must need to change something.  I followed the instructions and when I tried to open the ASP page in IE, PhotoShop opened LOL.  I might have to change my file associations in PhotoShop, I think maybe PS sees it as a plugin.  Am I correct in thinking that, once I fix my PhotoShop issue, I can run that test page locally?

Can the VBS in that MS test page be translated to JScript?  If so, could you show me?

I only wanted to validate the data with JavaScript because I know I can.  Can I use JScript to validate on the server?

As you can see I really want to use JScript as much as possible because it is so much like JavaScript.  Is it possible to use only JScript to do this or do I need to use some VBS or VB?  If I have to use VBS or VB, where will I need to use it?

 

by: wfRGBPosted on 2003-08-03 at 20:51:25ID: 9064142

"SQL and ODBC means converting excel to Microsoft Access"

No. It does not. There is a ODBC driver for excel spreadsheets ;-)

 

by: wfRGBPosted on 2003-08-03 at 21:20:58ID: 9064247

ASP is as you might know a serverside scripting technology.
If you want to run the example on MS support page you will need IIS (or PWS if you are runing Win9x).

And yes I can translate the page to javascript if you want me to.

But it's not that difficult so I don't think that you should have
too much truble to learn how to do it yourself since you already know JS.
In fact I think that you should since VBS/ASP is a very good
thing to know if you are working as a webdeveloper.

 

by: gphPosted on 2003-08-03 at 21:49:56ID: 9064339

I'm using win98.  I went through the steps in the ODBC that the page described but what is PWS?  Also is SQL and mySQL the same thng?

What I'm not sure about translating is the first line:

1) offline I've found that something like this in VBS:

blah = CreateObject("WScript.Shell")

is this in JS:

blah = new ActiveXObject('WScript.Shell')

I can't see how I would do that with this line.  Would it not need to be converted on the server?

objConn = Server.CreateObject("ADODB.Connection")

 

by: wfRGBPosted on 2003-08-03 at 21:52:03ID: 9064354

Sorry, I missed that SQL part.

SQL is a query language that allows you to extract, update, insert and manipulate data of a datasource/database.

lets say that you have a table (company_staff) in a DB that looks like this:

+---------------------+--------------------+----------------------------+
| firstname            | lastname          | employment_number  |
+---------------------+--------------------+----------------------------+
| john                    | Doe                   | 1234567890               |
+---------------------+--------------------+----------------------------+
| jane                    | Doe                   | 0987654321               |
+-------------------------------------------------------------------------+

if you want to get john doe's employment number you can use a SQL query like below

"SELECT employment_number FROM company_staff WHERE firstname='john' AND lastname='Doe';"

which will give you:

employment_number
-----------------------------
1234567890

I hope I've made things a litte clearer.

 

by: gphPosted on 2003-08-03 at 21:54:29ID: 9064376

I had 2 questions on translating but I think I figured the second out.  I forgot to remove  the "1)" in my last post.

 

by: wfRGBPosted on 2003-08-03 at 22:00:46ID: 9064442

PWS = Personal Webserver. If i remember things correct you can find it on your windows installation cd.

 

by: wfRGBPosted on 2003-08-03 at 22:04:26ID: 9064485

mySQL is a server software which handles databases, SQL is a programing language.

 

by: wfRGBPosted on 2003-08-03 at 22:06:08ID: 9064506

You should leave Server.CreateObject("ADODB.Connection") as it is.

 

by: gphPosted on 2003-08-03 at 22:25:41ID: 9064727

>  You should leave Server.CreateObject("ADODB.Connection") as it is.

That's what threw me off in the other thread where you gave the JScript answer.  It almost seems like all you have to do is puts some brackets in the right place and bang, it's translated to JScript :)  I think it is easier to convert to JScript rather than client side JavaScript.  I don't think I'll have a problem with translating.

>  PWS = Personal Webserver. If i remember things correct you can find it on your windows installation cd.

I have seen Personal Webserver somewhere and am very happy to know I can run this locally until I figure it out.

>  mySQL is a server software which handles databases, SQL is a programing language.

I see, I learned alot here, thank you all.

 

by: sciwriterPosted on 2003-08-03 at 22:40:40ID: 9064905

Thanks gph -- this all happened too quick to see the final result -- are you happy?

Basically, I think, from the 3 different perspectives given, you may be off to a roaring start, and I hope it has helped simplify it for you.  It really isn't that tough, but the first time through, it will take a long time.  After it's done, I'll bet you'll say -- hey, I could do it all without "server DB" programming.  That was the thrust of my remarks.  I still think you can do it all without SQL and a mini DB server, check ASP-VB-JS and see if I'm not right, when you get the time.  

Let me know the final result please.  Only by these interactions, and seeing someone to the end , do I learn too.

Cheers

Sci

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...