473,324 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

ASP and using linked tables

Hi folks,

I'm fairly new to the ASP/SQL arena and need a hand wrapping my mind around
something. First allow me to paint you a picture:

I'm developing an ASP page (not .net) for inventory management.

At the moment I have 2 tables.

1) ProductTable has the following columns: ID, Part, Description, Price and
Manufacturer (INT value)

2) ManufacturerTable: ID (key to manufacturer above), ManuName

I have a form in which a user enters information on a new product and on
this form I have a drop down list which is populated via the ManuName table
which displays all available manufacturers from the
manufacturertable.manufacturer column.

What I want is that when a user hits submit, it saves the info to the
producttable and takes the corresponding integer from the
ManuName that the user selects and places it in the
ProductTable.Manufacturer value along with the rest of the info. I'm unsure
of how to capture the corresponding integer value based on the Manufacturer
Name (which is a text value) and send it to the ASP file doing the actual
insert. Can anyone lend a hand?

Thanks,
Dave
Jul 22 '05 #1
1 1977
Gazing into my crystal ball I observed "Dave" <ov******@cogeco.ca>
writing in news:kt*******************@read2.cgocable.net:
Hi folks,

I'm fairly new to the ASP/SQL arena and need a hand wrapping my mind
around something. First allow me to paint you a picture:

I'm developing an ASP page (not .net) for inventory management.

At the moment I have 2 tables.

1) ProductTable has the following columns: ID, Part, Description, Price
and Manufacturer (INT value)

2) ManufacturerTable: ID (key to manufacturer above), ManuName

I have a form in which a user enters information on a new product and
on this form I have a drop down list which is populated via the
ManuName table which displays all available manufacturers from the
manufacturertable.manufacturer column.

What I want is that when a user hits submit, it saves the info to the
producttable and takes the corresponding integer from the
ManuName that the user selects and places it in the
ProductTable.Manufacturer value along with the rest of the info. I'm
unsure of how to capture the corresponding integer value based on the
Manufacturer Name (which is a text value) and send it to the ASP file
doing the actual insert. Can anyone lend a hand?


You have the id of the manufacturer as you pull it out for the drop down
don't you?

<form method="post" action="post.asp">
<label for="manufacturer">
<select name="manufacturer" id="manufacturer">
<%
While Not rs.EOF
id = trim(rs("manufacturer"))
manuname = trim(rs("manuname"))%>
<option value="<%=id%>"><%=manuname%></option>
<% rs.MoveNext
wend
rs.Close
set rs = nothing
%>
</select>
</label>
<label for="part">
<input type="text" id="part" name="part" value="<%=part%>" /></label>
<label for="description">
<input type="text" id="description" name="description" value="<%
=description%>" /></label>
<label for="price">
<input type="text" id="price" name="price" value="<%=price%>" />
</label>
<input type="submit" value="Submit" />
</form>

Now in Post.asp

<% manufacturer = request.form("manufacturer")
part = request.form("part")
description = request.form("description")
price = request.form("price")

insert = "INSERT INTO producttable "
insert = insert & " (Part, Description, Price, Manufacturer)"
insert = insert & " VALUES ('" & part & "', '" & description & "', '" &
price & "', " & manufacturer & ")"

Have a look at http://www.intraproducts.com/beta/requiredform.asp for some
ways to deal with required information, and other code snippets.
--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: pinballjim | last post by:
Hello everyone, I'm looking for a simple way to create a local copy of a linked table. I've got a database that links about 10 tables from other databases. This works fine on my machine, but I...
2
by: Internet Arrow Limited | last post by:
Hi, I have a requirement to write an access application that must run under access97 and access2K. Some users will use Acess2K to access data that will also be accessed by Access97 users. The...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
2
by: Vern Shellman | last post by:
We've got a form in Access 97 SR-2 that works fine with local tables. The pertinent VB code populating a combo box looks like this: Private Function ShowMOFInfo() Dim db As Database Dim rec...
6
by: Don Leverton | last post by:
Hi All, I've got a situation where I am developing an Access 97 app for a client, and am in the "beta testing" stage. I have split the app up, using the DB splitter, into front-end /back-end...
1
by: S. van Beek | last post by:
Dear reader, How to increase the response in case of working with linked tables, program in frond end mdb and tables in back end mdb. For possible combinations and their response...
2
by: Jill Elaine | last post by:
I am building an Access 2002 frontend with linked tables to an encrypted Paradox 7 database. When I first create these linked tables, I'm asked for the password to the encrypted Paradox database,...
0
by: Chandan Ahuja | last post by:
Hello , I use MFC DAO classes to access my MS access database . I am using some linked tables(Linked to Oracle) in my MS Access database . Also i have some queries in my databse , these...
7
by: ApexData | last post by:
Hello I currently Link the FE/BE using the LinkTables Option and the Linked Table Manager. Any time I need to move the BE to another location, I have to go through this process over again. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.