473,385 Members | 1,546 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,385 software developers and data experts.

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\deliveries (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 2406

"Brave" <br*********@yahoo.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.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\deliveries (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.comwrote:
"Brave" <bravespl...@yahoo.comwrote in messagenews:11*********************@e3g2000cwe.goo glegroups.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\deliveries (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*********@yahoo.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.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.comwrote:
>"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.go oglegroups.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\deliveries (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.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=\\*********Path to database*******.mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(mySQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comwrote:
"Brave" <bravespl...@yahoo.comwrote in messagenews:11**********************@e3g2000cwe.go oglegroups.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.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.goo glegroups.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\deliveries (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=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;

Excel is pretty much the same:

Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Fullpath\MyExcel.xls;Extended Properties=""Excel
8.0;HDR=Yes;IMEX=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*********@yahoo.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.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.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=\\*********Path to database*******.mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(mySQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comwrote:
>"Brave" <bravespl...@yahoo.comwrote in
messagenews:11**********************@e3g2000cwe.g ooglegroups.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.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.go oglegroups.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\deliveries (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*******@hotmail.comwrote in message
news:eS**************@TK2MSFTNGP03.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=Microsoft.Jet.OLEDB.4.0;Data
Source=\somepath\mydb.mdb;

Excel is pretty much the same:

Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Fullpath\MyExcel.xls;Extended Properties=""Excel
8.0;HDR=Yes;IMEX=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*********@yahoo.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.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.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=\\*********Path to database*******.mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(mySQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comwrote:
>>"Brave" <bravespl...@yahoo.comwrote in
messagenews:11**********************@e3g2000cwe. 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.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.g ooglegroups.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\deliveries (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.comwrote:
Better still

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

"Mike Brind" <paxton...@hotmail.comwrote in messagenews:eS**************@TK2MSFTNGP03.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=Microsoft.Jet.OLEDB.4.0;Data
Source=\somepath\mydb.mdb;
Excel is pretty much the same:
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Fullpath\MyExcel.xls;Extended Properties=""Excel
8.0;HDR=Yes;IMEX=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...@yahoo.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.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.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=\\*********Path to database*******.mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(mySQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11**********************@e3g2000cwe.g ooglegroups.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.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.go oglegroups.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\deliveries (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
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 {...
4
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...
3
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...
7
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...
44
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...
2
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...
2
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
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
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.