Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Help with a new project
Old 03-21-2006, 01:28 PM Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
I am working on a project with the following information:

1. I have an exploded view of a machine assembly
2. I have an Access database with all the parts listed in the assembly
3. In the database is included:
What machine the assembly came from, name of the assembly, the part number of each part on the assembly, description of each part and location in our parts cabinet
4. I will create a web page from the assembly drawing with hot spots and when you point to one of the hot spots a box will pop up and display the information about the part pointed to.

How can I do this on a stand-alone computer

Thank you for all you help

John
Johntech is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-23-2006, 11:16 AM Re: Help with a new project
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Hi John, (missed it to welcome you the first time around.. ..)

I think you already made this post..!..?

your previous post

The answer depends on what you are willing to do, as Chris
gives a few examples, If you want more information, we will
need more information..
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-23-2006, 02:11 PM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
[quote=ChipJohns]Hi John, (missed it to welcome you the first time around.. ..)

I think you already made this post..!..?

your previous post


The answer depends on what you are willing to do, as Chris
gives a few examples, If you want more information, we will
need more information..


What information do you want? I have a win 2k pro machine with IIS installed. I can map the diagram for the hot spots. I'm not sure what code to write to display the part information that will be pulled from the Access database when I click on the part. I have tried a few simple ASP , "Hello World" to make sure my machine is setup correctly. This will be a stand alone app to be run on a single PC with no network connection.

I hope this helps. Let me know if you need more info

John
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-23-2006, 03:10 PM Re: Help with a new project
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Great John,

What you need to do first is set up the ODBC DSN for the database.

1- Click Start ->Settings ->Control Panel
2- Open ODBC Data Source Administrator
3- Click Add to create a new System data source
4- Select the MS Access Drover (*.mdb) anc Click Finish
5- Fill in the Data source name (DSN)

It's been a while since I have done this, You should be able to work your way through it...

After this you should be able to gain access the database through asp.


Do you know how to write sql statements? This is the next step, to write what we call a connection string and then an sql statement to pull the info from the database.

*** DON'T FREAKOUT, YOU CAN DO THIS ***

After you do this you will see that it isn't that bad. You will even want to do more of it..

Let us know how you come along with this and we'll get you started on the rest.

ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-24-2006, 12:19 AM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
Hello Chip

Thank you very much for getting me started in the right direction! I have seen the sql statements and have seen a lot of connection strings and even tried a few but I could never get any of them to do anything.

The name of the Access database that I will be using is PartsList.mdb and the table in it is called tblPartsList. Right now I only have 3 records in it with 3 fields. They are PartNo, Description and Location.

Do I have to store all my work in a particular directory for this to work? It seems I read somewhere it has to be in the WEBROOT directory?

Well Chip... I followed you instructions and I guess I'm ready for the next step!

John
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-24-2006, 12:27 AM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
[quote=ChipJohns]Hi John, (missed it to welcome you the first time around.. ..)

I think you already made this post..!..?

your previous post

I posted this request in both forums because part of it will be HTML coding and the other part will be ASP coding. I have taken several classes in HTML programming but have never did anything like this before. I thought if no one replied in one forum I might get lucky in the other...... AND HERE YOU ARE!!!

I appreciate your time and patients!!

John
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-24-2006, 03:55 AM Re: Help with a new project
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
actually you are going to have a whole mixture of languages;

ASP for accessing the database and creating the pages(s), HTML + CSS for creating the look plus DHTML (javascript) for the onMousover event to display the "pop-up" box.

at first look it would seem to be a complex problem however if you are creating the page by hand and simply need the code to get the data it's not that difficult, time consuming but not difficult.

I'll see what I can do as a sample a bit later on
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-24-2006, 06:12 AM Re: Help with a new project
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Try this and see what happens.

Notice that you need to change the dsn name to the name you assigned on your server..

This is just to test and see if you are getting a connection. You can worry about making it look right later on..

and if this code isn't good. Blame Chris. he taught me everything that I know

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>


<%
'This is your connection and the sql statement
Dim objConnection, objRS, strQuery
Dim strConnection

' change YourDSN to the name you gave the DSN datasource

set objConnection = Server.CreateObject("ADODB.Connection")
strConnection = "Data Source=YourDSN;"
objConnection.Open strConnection
Set objRS = Server.CreateObject("ADODB.Recordset")
Set objRS.ActiveConnection = objConnection

'SQL RecordSet 
strQuery = "SELECT * FROM tblPartsList"
objRS.Open strQuery
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Output Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

PartNo -  Description - Location.
<%  
While Not objRS.EOF

Response.Write objRS("PartNo")
Response.Write " - "
Response.Write objRS("Description")
Response.Write " - "
Response.Write objRS("Location")

objRS.MoveNext
Wend
%>

</body></html>
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-24-2006, 12:01 PM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
Quote:
Originally Posted by chrishirst
actually you are going to have a whole mixture of languages;

ASP for accessing the database and creating the pages(s), HTML + CSS for creating the look plus DHTML (javascript) for the onMousover event to display the "pop-up" box.

at first look it would seem to be a complex problem however if you are creating the page by hand and simply need the code to get the data it's not that difficult, time consuming but not difficult.

I'll see what I can do as a sample a bit later on

Thank you Chris!!

In my 2nd HTML class I have worked with Javascript and CSS a little so that is not totally new to me.

I appreciate your help too!!

John
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-25-2006, 01:03 AM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
Hi Chip

For the DSN name I used strConnection = "Data Source=parts;" thats how I set it up in the System DSN - Parts

The address I used to view the page was http://localhost/partslist.asp

With the code you gave me, here is what the page displayed.

================================================

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

Technical Information (for support personnel)
  • Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.
    /partslist.asp, line 14
  • Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
  • Page:
    GET /partslist.asp
  • Time:
    Friday, March 24, 2006, 11:42:02 PM
==================================================

I did try a short program:
<%
Response.Write "<p>The Server time is now:"
Response.Write Time
Response.Write "</p>"
%>

and it printed the correct time and date everytime I clicked the refresh button. So it looks like I have the IIS working correctly.

John
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-25-2006, 01:39 AM Re: Help with a new project
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Ummm ...

It's time to bring in the other guys. Help will be along soon!

I have only been doing this a few months myself, I can only get you so far, and, I think we are there
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-25-2006, 01:48 AM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
Quote:
Originally Posted by ChipJohns
Ummm ...

It's time to bring in the other guys. Help will be along soon!

I have only been doing this a few months myself, I can only get you so far, and, I think we are there

HI Chip

I got it working!!!!!!

I went back through all the code again and rechecked EVERYTHING. Next I went back and verified my Access database. Some how there was an error in it. I recreated the database and ...wala... it worked. I made some adjustments to align the data and I am very happy!!!

John
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-27-2006, 12:54 AM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
Now that is behind me, on to the next step of figuring out how to display the data for the part I click on. Do I somehow pass the part number to the routine so that it displays just the information for that part? Would I include the part nimber in the tag for the hot spot?

Also If I create this routine for a different part of the machine, I would just create another database with those part numbers in it or just use the same database?

One last thing for now.... When I create a small popup window to display the individual part number info, Should I put all the Dim and opening statements in the code for the popup? Should I include statements to close everything when I'm done too?

Getting excited!!

John
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-27-2006, 01:55 AM Re: Help with a new project
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Quote:
Now that is behind me, on to the next step of figuring out how to display the data for the part I click on. Do I somehow pass the part number to the routine so that it displays just the information for that part? Would I include the part nimber in the tag for the hot spot?
Yes. You will need to pass the part number on. The best way to do this is through a query string.

Ex: http://www.yoursite.com/displaypage.asp?part=3305

Quote:
Also If I create this routine for a different part of the machine, I would just create another database with those part numbers in it or just use the same database?
Not another database. Just make another table in the current database... I would make a copy of the original table and then just rename it. Then you can use the same pages and just change the table name in the sql statement.

Quote:
One last thing for now.... When I create a small popup window to display the individual part number info, Should I put all the Dim and opening statements in the code for the popup? Should I include statements to close everything when I'm done too?
Yes. All of the code will go in the page that the popup script loads.

Quote:
Getting excited!!
GREAT!
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-27-2006, 07:48 AM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
Ok Chip
Lets start off with the code you gave me above. If I want to just print out the info for the part Y684300, which is in my parts list, then on the address line I would type

http://localhost/partslist5.asp?part=Y684300 correct?

Also I would have to get rid of the While/Wend statements correct?

Sorry for all the questions ! I want to understand how this works so I know what to do when it doesn't.

John
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-27-2006, 09:44 AM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
Chip

Ok I changed this line of code to display the part info

strQuery = "SELECT * FROM tblPartsList Where PartNo = 'Y684300'"

and it printed just that information, just like I wanted.

So do I have to put a variable in there to be able to use

http://localhost/partslist5.asp?part=Y684300 ???
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-27-2006, 04:08 PM Re: Help with a new project
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
You got it!

Then you will need to get that info to the proper format. before your query statement try this:

Dim sPart
sPart = Request.QueryString("part")


Dim sPart sets the variable. It assigns the value of part received in the query string. It assigns this to the asp variable sPart.

So you will just change the name in your sql statement to sPart..

strQuery = "SELECT * FROM tblPartsList Where PartNo = '" & sPart & "'" (These last three char are -quote, apotrophe, quote)

Then in your sql statement use sPart instead of part. This is kind semantics what names you give to everything. Just by naming your variable sPart helps you keep track of everything. There is a difference between part which is the variable in your query string passed with the url, and sPart wich is the variable assigned in asp.

This is the normal convention that many asp developers use. The biggest thing is for you to use a convention. be consistent. That way when 2 years from now you need to look at your code again you will save yourself a lot of time understanding what is what simply by the names you have assigned..

Hope this helps. Let us know

Last edited by ChipJohns; 03-27-2006 at 04:14 PM..
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-28-2006, 12:50 AM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
Quote:
Originally Posted by ChipJohns
You got it!

This is the normal convention that many asp developers use. The biggest thing is for you to use a convention. be consistent. That way when 2 years from now you need to look at your code again you will save yourself a lot of time understanding what is what simply by the names you have assigned..

Hope this helps. Let us know
Thank you Chip!!

I have been writing in comments along the way as I was entering the code. This will help me remember what everything is doing. Your name is also in there as writer of the main code!!

The first try with Y684300 number worked. Then I tried another number and it didn't work. In my reading on the internet I thought it said something about setting the recordset and the connection = Nothing when you were done. I went back and took those 2 statements out of the code and now it works everytime.

I really appreciate the time you took to explain everything. It makes it easier to understand and to see how the code works.

The next thing I will have to figure out is how to change the part information, if the part has been moved, deleted or there is a new part added. I will probably set this up in Access, but if you wouldn't mind "walking with me" a little further, I would like to display the info with the option to edit, delete or add the displayed data to the database. I will try to do as much on my own to write the code and figure out what to do.

Once that part works, I need to get my diagram scanned and define the hot spots and then connect the 2 together.

The guys I work with and my manager are getting excited to see how this all works. We have 15 manuals to search for replacement parts and you never know which manual to look in. With this program in our shop finding a part to a module will be a snap. When all finished, I will send you a copy.

Again Thank you for your patients and tutoring!!

John
Johntech is offline
Reply With Quote
View Public Profile
 
Old 03-28-2006, 01:02 AM Re: Help with a new project
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Excelent John!

Hey, you are doing it. We are just helping. I have received so much help here it is unbelievable.

Let us know when you get to the next step.

And, keep coming back to the forum. And, don't be afraid to help others. If you know the answer, make the post. Don't feel like you're not qualified, because for the record I am not qualified. THe guys here are awesome, so when you and me answer the easier questions, it gives them the time to spend on the more difficult questions.

Like mine..

Don't pass the buck at work man, take credit.!!!
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 04-02-2006, 12:24 AM Re: Help with a new project
Johntech's Avatar
Average Talker

Posts: 24
Trades: 0
Hi Chip and anyone else reading this

I now have the first exploded diagram with the hot spots on it. How do I pass the information from the hot spot link to the routine that displays the part info?
Do I put the link to display the part info the the AREA definition like this?

<AREA SHAPE="RECT" COORDS="97,166,114,180" HREF="http://localhost/partslist.asp?part=8484243" TITLE="8484243">

Thanks for the help!!

John
Johntech is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with a new project

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.80068 seconds with 12 queries