473,789 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A general "How would you code this" question.

I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.

I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveri es (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)

I am not as familiar with code as I would like, but it seems I would
need something like this:

If option1 = this, and option2 = this, then the answer (field name
Result) = this

I know that looks stupid, but I am hoping to show you how I am
approching this in my head.

Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.

Thanks for any time you can give.

Nov 6 '06 #1
7 2424

"Brave" <br*********@ya hoo.comwrote in message
news:11******** *************@e 3g2000cwe.googl egroups.com...
>I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.

I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveri es (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)

I am not as familiar with code as I would like, but it seems I would
need something like this:

If option1 = this, and option2 = this, then the answer (field name
Result) = this

choosing the states and then submitting the form would give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this information?

You would need some sort of lookup table.
>
I know that looks stupid, but I am hoping to show you how I am
approching this in my head.

Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.

Thanks for any time you can give.

Nov 6 '06 #2
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.

States are listed down the side and accross the top of the excel sheet.
(exp: Ohio and Maine = UPS)

On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
"Brave" <bravespl...@ya hoo.comwrote in messagenews:11* *************** *****@e3g2000cw e.googlegroups. com...
I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveri es (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form would give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this information?

You would need some sort of lookup table.


I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted text -
Nov 6 '06 #3

"Brave" <br*********@ya hoo.comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.

States are listed down the side and accross the top of the excel sheet.
(exp: Ohio and Maine = UPS)

ok
well i would load the data into a database, but you can read straight from
the excel file also.

you need to make a connection to the data

then use a SQL query to select the answere and reder it to the client.

do you know how to make a connection to a excel sheet?

do you know how to make a SQL query?

On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
>"Brave" <bravespl...@ya hoo.comwrote in
messagenews:11 *************** ******@e3g2000c we.googlegroups .com...
>I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveri es (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this information?

You would need some sort of lookup table.


I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted
text -

Nov 6 '06 #4
I have done some simple update queries, but nothing very advanced. I
have never connected to an excel sheet

Here is an example of a connection to an MS Access db I did. Would it
structure itself in a similar way?

<%
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open "driver={Micros oft Access Driver
(*.mdb)};;DBQ=\ \*********Path to database******* .mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(my SQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comw rote:
"Brave" <bravespl...@ya hoo.comwrote in messagenews:11* *************** ******@e3g2000c we.googlegroups .com...
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.
States are listed down the side and accross the top of the excel sheet.
(exp: Ohio and Maine = UPS)ok
well i would load the data into a database, but you can read straight from
the excel file also.

you need to make a connection to the data

then use a SQL query to select the answere and reder it to the client.

do you know how to make a connection to a excel sheet?

do you know how to make a SQL query?
On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
"Brave" <bravespl...@ya hoo.comwrote in
messagenews:11* *************** *****@e3g2000cw e.googlegroups. com...
I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveri es (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this information?
You would need some sort of lookup table.
I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted
text -- Hide quoted text -- Show quoted text -
Nov 6 '06 #5
Hmmm. For connecting to Access, you are better off using the OLEDB driver
rather than the ODBC driver in your example

Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=\somepat h\mydb.mdb;

Excel is pretty much the same:

Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=Fullpath \MyExcel.xls;Ex tended Properties=""Ex cel
8.0;HDR=Yes;IME X=1"""

HDR=Yes indicates that the worksheet has a header row. Remove IMEX=1 if you
want to write to the worksheet.

sql="SELECT field1, field2 FROM [Sheet1$]" is an example select statement.
Notice that the worksheet name is followed by a $ sign.

--
Mike Brind
"Brave" <br*********@ya hoo.comwrote in message
news:11******** *************@m 7g2000cwm.googl egroups.com...
>I have done some simple update queries, but nothing very advanced. I
have never connected to an excel sheet

Here is an example of a connection to an MS Access db I did. Would it
structure itself in a similar way?

<%
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open "driver={Micros oft Access Driver
(*.mdb)};;DBQ=\ \*********Path to database******* .mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(my SQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comw rote:
>"Brave" <bravespl...@ya hoo.comwrote in
messagenews:11 *************** *******@e3g2000 cwe.googlegroup s.com...
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.
States are listed down the side and accross the top of the excel sheet.
(exp: Ohio and Maine = UPS)ok
well i would load the data into a database, but you can read straight
from
the excel file also.

you need to make a connection to the data

then use a SQL query to select the answere and reder it to the client.

do you know how to make a connection to a excel sheet?

do you know how to make a SQL query?
On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
"Brave" <bravespl...@ya hoo.comwrote in
messagenews:11 *************** ******@e3g2000c we.googlegroups .com...
>I am hoping for a code example of how to do this, and hopefully it
will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for
a
courier used for pickup\deliveri es (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this
information?
>You would need some sort of lookup table.
I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If
you
could offer a sample of code, I'm sure I could use it as a template
for
other projects. My idea is that this is just standard IF this THEN
that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted
text -- Hide quoted text -- Show quoted text -

Nov 6 '06 #6
Better still

I would upload my data into access, is there a reason for the data staying
in excel format?

"Mike Brind" <pa*******@hotm ail.comwrote in message
news:eS******** ******@TK2MSFTN GP03.phx.gbl...
Hmmm. For connecting to Access, you are better off using the OLEDB driver
rather than the ODBC driver in your example

Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=\somepat h\mydb.mdb;

Excel is pretty much the same:

Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=Fullpath \MyExcel.xls;Ex tended Properties=""Ex cel
8.0;HDR=Yes;IME X=1"""

HDR=Yes indicates that the worksheet has a header row. Remove IMEX=1 if
you want to write to the worksheet.

sql="SELECT field1, field2 FROM [Sheet1$]" is an example select statement.
Notice that the worksheet name is followed by a $ sign.

--
Mike Brind
"Brave" <br*********@ya hoo.comwrote in message
news:11******** *************@m 7g2000cwm.googl egroups.com...
>>I have done some simple update queries, but nothing very advanced. I
have never connected to an excel sheet

Here is an example of a connection to an MS Access db I did. Would it
structure itself in a similar way?

<%
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open "driver={Micros oft Access Driver
(*.mdb)};;DBQ= \\*********Path to database******* .mdb;"
mySQL="INSER T INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(m ySQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comw rote:
>>"Brave" <bravespl...@ya hoo.comwrote in
messagenews:1 1************** ********@e3g200 0cwe.googlegrou ps.com...

Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.

States are listed down the side and accross the top of the excel
sheet.
(exp: Ohio and Maine = UPS)ok
well i would load the data into a database, but you can read straight
from
the excel file also.

you need to make a connection to the data

then use a SQL query to select the answere and reder it to the client.

do you know how to make a connection to a excel sheet?

do you know how to make a SQL query?

On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
"Brave" <bravespl...@ya hoo.comwrote in
messagenews:1 1************** *******@e3g2000 cwe.googlegroup s.com...

I am hoping for a code example of how to do this, and hopefully it
will
help me to see an easy way to code what seems to be a huge monster.

I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing
for a
courier used for pickup\deliveri es (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)

I am not as familiar with code as I would like, but it seems I
would
need something like this:

If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form
would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this
information ?

You would need some sort of lookup table.

I know that looks stupid, but I am hoping to show you how I am
approching this in my head.

Any ideas on how you would approch this project would be great. If
you
could offer a sample of code, I'm sure I could use it as a template
for
other projects. My idea is that this is just standard IF this THEN
that
coding, but I don't know the basics enough to create the code from
scratch.

Thanks for any time you can give.- Hide quoted text -- Show quoted
text -- Hide quoted text -- Show quoted text -


Nov 8 '06 #7
No, my plan is to do it in access. I was just wondering about the
specifics. I'm assuming that functionality may come in handy on a
future project.

Thanks for everything.

On Nov 8, 12:12 pm, "Slim" <m...@here.comw rote:
Better still

I would upload my data into access, is there a reason for the data staying
in excel format?

"Mike Brind" <paxton...@hotm ail.comwrote in messagenews:eS* *************@T K2MSFTNGP03.phx .gbl...
Hmmm. For connecting to Access, you are better off using the OLEDB driver
rather than the ODBC driver in your example
Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=\somepat h\mydb.mdb;
Excel is pretty much the same:
Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=Fullpath \MyExcel.xls;Ex tended Properties=""Ex cel
8.0;HDR=Yes;IME X=1"""
HDR=Yes indicates that the worksheet has a header row. Remove IMEX=1 if
you want to write to the worksheet.
sql="SELECT field1, field2 FROM [Sheet1$]" is an example select statement.
Notice that the worksheet name is followed by a $ sign.
--
Mike Brind
"Brave" <bravespl...@ya hoo.comwrote in message
news:11******** *************@m 7g2000cwm.googl egroups.com...
>I have done some simple update queries, but nothing very advanced. I
have never connected to an excel sheet
Here is an example of a connection to an MS Access db I did. Would it
structure itself in a similar way?
<%
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open "driver={Micros oft Access Driver
(*.mdb)};;DBQ=\ \*********Path to database******* .mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(my SQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comw rote:
"Brave" <bravespl...@ya hoo.comwrote in
messagenews:11 *************** *******@e3g2000 cwe.googlegroup s.com...
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.
States are listed down the side and accross the top of the excel
sheet.
(exp: Ohio and Maine = UPS)ok
well i would load the data into a database, but you can read straight
from
the excel file also.
>you need to make a connection to the data
>then use a SQL query to select the answere and reder it to the client.
>do you know how to make a connection to a excel sheet?
>do you know how to make a SQL query?
On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
"Brave" <bravespl...@ya hoo.comwrote in
messagenews:11 *************** ******@e3g2000c we.googlegroups .com...
>I am hoping for a code example of how to do this, and hopefully it
will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing
for a
courier used for pickup\deliveri es (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I
would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form
would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this
information?
>You would need some sort of lookup table.
I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If
you
could offer a sample of code, I'm sure I could use it as a template
for
other projects. My idea is that this is just standard IF this THEN
that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted
text -- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
Nov 8 '06 #8

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

Similar topics

1
5666
by: Peter King | last post by:
if you assign multiple classes in order to keep your classes generic e.g ..classA { position.absolute; left:5 top:5 height:200 width:800 } ..classB { background-color: red} ..classC { background-color: green} <div id="div1" class="classA classB" ... but then want to dynamically assign a new class
4
2534
by: J. Campbell | last post by:
From reading this forum, it is my understanding that C++ doesn't require the compiler to keep code that does not manifest itself in any way to the user. For example, in the following: { for(int i = 0; i < 10; ++i){ std::cout << i << std::endl; for(int j = 0; j < 0x7fffffff; ++j){} } }
3
2203
by: Graham | last post by:
On page 89 of Stroustrup's book "The C++ Programming Language" 3rd Ed. He says that multidimensional arrays are best avoided outside low-level code. What precisely does he mean by low-level code? That is fairly relative terminology. Is he saying that the use of multidimensional arrays in C++ are not desirable? That doesn't seem right to me.
7
1598
by: Daniel Ervi | last post by:
Hi All, I have a question for the group as I can't seem to come up with any suitable solutions. I'm not that new to programming or C#, but neither am I very fluent yet, so I'd appreciate any help at mastering my craft. What I am trying to do is best illustrated in code: public class TBase
44
4213
by: Tolga | last post by:
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a good concept?
2
2007
by: danny.dion | last post by:
Hi ! I have a question about JScript : I have an object class wich dynamically creates a control in the page. Then it binds an event to that control, pointing on one of its methods (the object's). This method, in turn, calls other of its own methods... The binding seems ok and the change() method does get called. But I get an error message (This object does not support this property or method) when I call other methods on the...
2
1565
by: Bryan | last post by:
Hello all, Can anyone explain when one should use the "document" object and when one should use the "this" object? Also, is the "self" object the same as the "document" or "this" object?
8
1642
by: mdh | last post by:
May I ask this. Given the declaration: int myf( int, int); and a function pointer: (*fp)=int myf(int, int); where I am initializing fp to point at myf....or trying to..
2
2052
by: Ken Tilton | last post by:
Total JS noob here, but porting my hairy Common Lisp Cells (dataflow) package -- long intro on my blog: http://smuglispweeny.blogspot.com/2008/02/cells-manifesto.html ....so I am getting into some fun stuff straight-away. I am happy to see _defineGetter_/Setter_ here: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object
0
9661
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9506
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10403
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10193
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9978
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9015
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6755
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4087
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.