473,385 Members | 1,555 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.

Setting Up a Form-

theimmortalmooo
My boss wanted me to make a data entry form so Jane can type customers' email addresses into our database. It needs to have two fields: store number and email address, and a submit button that inserts into the mailling list. ON my resume, i didn't put that I knew SQL....but yet I am still being asked to do this, can any one help me?

Iam currently using dreamweaver here is link to what i made

http://moosplayhouse.com/webice/addresses/addresses.htm
Jun 14 '07 #1
52 4644
jhardman
3,406 Expert 2GB
Welcome to the scripts. Your form looks nice.

I assume you posted here because you know some asp basics and/or you believe you're server can handle it. As a first step, I would make a script page that can accept this information. I wouldn't worry yet about setting up the db connection.

The simplest way to handle form data is as follows:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. for each x in request.form
  3.    response.write x & ": " & request.form(x) & "<br>" & vbNewLine
  4. next %>
You can save this as "tester.asp" and send your form data there ( make sure the form tag says <form method="post" action="tester.asp"> ) Try this and let me know what happens.

Jared

ps what is your avatar supposed to be?
Jun 14 '07 #2
thanks for the warm welcome. here is a bigger Image of my avatar, I will try what you said right now

http://i16.photobucket.com/albums/b32/FF7zach/Avatars/Avatar.jpg

Its a skull that i photoshoped it a bit
Jun 14 '07 #3
this is my result,
the page opened as this
try for yourself, http://moosplayhouse.com/webice/addr...ddresses2.html

Method Not Allowed
The requested method POST is not allowed for the URL /webice/addresses/tester.asp.


and on the other serverhttp://webice.net/addresses/addresses2.html i got this response

Microsoft VBScript compilation error '800a0400'

Expected statement

/test/tester.asp, line 10

2.
^
Jun 14 '07 #4
jhardman
3,406 Expert 2GB

Microsoft VBScript compilation error '800a0400'

Expected statement

/test/tester.asp, line 10

2.
^
OK, the first address you gave uses apache server. Apache does not natively support "asp", it natively supports a similar scripting technology called "php". You can configure apache to support asp but if it isn't done already, it is probably not worth it. So first, check your system administrator and ask if it is already set up. Second, you will need to get php or whatever scripting method you end up using turned on. This will have to be between you and your system administrator.

the second server you listed does appear to be working, but the error listed makes no sense. could you post the source code for the tester.asp? maybe that will clear it up. (you can edit out anything that would violate your privacy)

Jared
Jun 14 '07 #5
sure thing


and the first server is the one for my website, i usually test thing there first, or use it to host the files so i can work from home.


this is the code in the tester
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>   1.
  9.       <%
  10.    2.
  11.       for each x in request.form
  12.    3.
  13.          response.write x & ": " & request.form(x) & "<br>" & vbNewLine
  14.    4.
  15.       next %>
  16. </body>
  17. </html>
Jun 14 '07 #6
I saved the address file as .asp this time http://webice.net/addresses/addresses.asp

and tried it, I think it worked, But Where does it save the information to?

(sorry I am new at the whole programming thing, I could do basic HTML, and XHTML, but eep on the php ,and etc)
Jun 14 '07 #7
jhardman
3,406 Expert 2GB
Sorry, the scripts' new way to display codes numbers the lines. Take off the numbering:
<%
for each x in request.form
response.write x & ": " & request.form(x) & "<br>" & vbNewLine
next %>
Jun 14 '07 #8
jhardman
3,406 Expert 2GB
I saved the address file as .asp this time http://webice.net/addresses/addresses.asp

and tried it, I think it worked, But Where does it save the information to?

(sorry I am new at the whole programming thing, I could do basic HTML, and XHTML, but eep on the php ,and etc)
I didn't give any instructions for saving it, I was just trying to go one step at a time. The instructions I gave you should just display the info from the form. Is the info you type into the form displayed when you hit submit?

Jared
Jun 14 '07 #9
Oke dokey, I put in the new code in the tester.asp File, replacing the old, next step?
Jun 14 '07 #10
Nope, it doesnt display just takes me back to a blank form,
Jun 14 '07 #11
jhardman
3,406 Expert 2GB
Oke dokey, I put in the new code in the tester.asp File, replacing the old, next step?
If tester.asp now displays the data you entered you are ready to set up your db.
Do you already know what type of db you want? Is this the only data you ever want to save, or can you imagine your boss coming to you in a week asking you to include the customer name, password, fave color etc?
Jun 14 '07 #12
jhardman
3,406 Expert 2GB
Nope, it doesnt display just takes me back to a blank form,
what does the form tag say? it should be <form action="tester.asp" ...>
Jun 14 '07 #13
ahah favorite color, nope this is it, wants it made so jane(who ever that is) can input customer emails, so she can send them out later on *i imagine she will copy and paste them*
Jun 14 '07 #14
it says
<form id="form1" name="form1" method="post" action="tester.asp">
Jun 14 '07 #15
i canged it to <form action="tester.asp" ...>

And it takes me to tester, but the page is blank
Jun 14 '07 #16
jhardman
3,406 Expert 2GB
it says
<form id="form1" name="form1" method="post" action="tester.asp">
check the code. I just went to http://webice.net/addresses/addresses.asp and the source code says <form ... action=""> this will send the form data back to the same page. Of course now that you changed the file extension to .asp, you can put that same code I gave earlier on that same page, and that will work as well.

Jared
Jun 14 '07 #17
oke dokey got it working, it shows, but does not save
Jun 14 '07 #18
jhardman
3,406 Expert 2GB
i canged it to <form action="tester.asp" ...>

And it takes me to tester, but the page is blank
hehehe. I put in the ellipses (...) to mean that the other attributes could remain, you don't have to do anything to change them. The form doesn't need to be named unless you refer to it in some javascript or something.

The method I thought was "post" by default, but I guess not. If you take out the method="post" then the data is sent slightly different (as part of the url) and you need to refer to it like this:
Expand|Select|Wrap|Line Numbers
  1. request.querystring("...
instead of
Expand|Select|Wrap|Line Numbers
  1. request.form("...
Jared
Jun 14 '07 #19
jhardman
3,406 Expert 2GB
oke dokey got it working, it shows, but does not save
good, I see it too. What are your thoughts on the db?
Jun 14 '07 #20
jhardman
3,406 Expert 2GB
good, I see it too. What are your thoughts on the db?
I mean to say, has your boss said "thou shalt use MS SQL SERVER" or are you free to decide? If you can decide, what are your options?

Jared
Jun 14 '07 #21
Was not specified, and B, I dont know what my options are,
X(

If you know of ANY options that would work, I will use that ^.^;
Jun 14 '07 #22
But we run off a SQL serv...does that help?
Jun 14 '07 #23
jhardman
3,406 Expert 2GB
But we run off a SQL serv...does that help?
SQL SERVER is good and fairly robust. do you have access to the db manager?

There are a whole slew of options from plain text (if Jane is just going to copy and paste, but I get the feeling that you may be asked shortly to set up an email engine ;) ) to an excel file (not a good idea in the long run) to MS access (better than excel and usually included with MS office suites) to the really robust dbs used in high-end applications like oracle, mySQL, and SQL SERVER.

If you have access to the SQL server manager, start there.

Jared
Jun 14 '07 #24
I do have access, to it, Looking for

sutherlands_mailing_list


what she wrote

Hey Danny, can you make a data entry form so Jane can type customers' email addresses into our database? It needs to have two fields: store number and email address, and a submit button that inserts into sutherlands_mailing_list. Can you save it as www.webice.net/addresses.asp
Jun 14 '07 #25
and we use MS access to update stuff
Jun 14 '07 #26
found the mailing list she was talking about....huge-the access document
Jun 14 '07 #27
jhardman
3,406 Expert 2GB
and we use MS access to update stuff
so the db is already set up for you? that makes it easier. From the way she wrote it, it appears that there may even be a DSN entry for this db. This would make the rest very easy. Can you check to see if a DSN is set up, and then check to see what the table(s) within the db is(are) named?

Jared
Jun 14 '07 #28
oke

dunno how to check for the DNS

but here are the sections
Email –First Name-Middle Name-Address1-address2-City-State-zip-dayphone-evening phone-catalogs-drawings id-store num-send email

She wants only the Email and the Store number to be able to be added tho
Jun 14 '07 #29
crunch time, less than a hour to get it done T.T *CRYS
Jun 14 '07 #30
jhardman
3,406 Expert 2GB
oke

dunno how to check for the DNS

but here are the sections
Email –First Name-Middle Name-Address1-address2-City-State-zip-dayphone-evening phone-catalogs-drawings id-store num-send email

She wants only the Email and the Store number to be able to be added tho
That's fine, but you need the name of the table. This is comparable to the worksheet name within an excel file. The file has a name, but within that file there may be multiple table names. To update or access the data you need to know the name of the table.

To find the dsn ( data source name) you will have to go into the control panel of your server. On mine that is start -> Settings -> control panel -> administrative tools -> data sources. (then click on the "system DSN" tab). This has likely changed in the 7 years or so since mine was updated, but tell me if you can find something similar and if there are DSNs listed that might be the one you want.

Jared
Jun 14 '07 #31
the name of the DNS is webice, and the access sheet name is
dbo_sutherland_mailing_list
Jun 14 '07 #32
jhardman
3,406 Expert 2GB
crunch time, less than a hour to get it done T.T *CRYS
not a problem, you're really almost there. The basic method to connect to a db (if there isn't a DSN and this will work on most dbs except SQL SERVER) is:

Expand|Select|Wrap|Line Numbers
  1. <% dim conn, rs
  2. set conn=Server.CreateObject("ADODB.Connection")
  3. conn.Provider="Microsoft.Jet.OLEDB.4.0"
  4. conn.Open "c:/inetpub/sutherlands_mailing_list.mdb"
  5. set rs = server.createObject("ADODB.recordset")
  6. rs.open "SELECT * FROM myTable", conn
  7. for each x in rs.fields
  8.    response.write x & "<br>" & vbNewLine
  9. next
  10. %>
This code just opens the table "myTable" and lists the fields

If you wanted to do the same thing but you have a DSN (and I believe you need a DSN to connect to a SQL SERVER DB) then it is actually a little easier:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. set conn=Server.CreateObject("ADODB.Connection") 
  3. conn.Open "sutherlands_mailing_list"
  4. set rs = ...
  5.  
the rest is the same

Try this and see if it works

Jared
Jun 14 '07 #33
which document does that go in ,tester?

and the DNS is webice where does that go?


ty again for all this
Jun 14 '07 #34
i put it in tester and this is what i got when i submitted

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/addresses/tester.asp, line 16
Jun 14 '07 #35
dns= webice
access document= dbo_sutherlands_mailing_list
fields needed to be added in are, email, store_num

I put this code in the tester
<%

set conn=Server.CreateObject("ADODB.Connection")

conn.Open "dbo_sutherlands_mailing_list"

set rs = server.createObject("ADODB.recordset")

rs.open "SELECT * FROM myTable", conn

for each x in rs.fields

response.write x & "<br>" & vbNewLine

next

%>













the full tester code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>tester</title>
</head>

<body>

<strong> SERVER IS NOT FULLY SET UP TO DOCUMENT YET TO ADD TO MAILING LIST</strong>

<br / <%

set conn=Server.CreateObject("ADODB.Connection")

conn.Open "dbo_sutherlands_mailing_list"

set rs = server.createObject("ADODB.recordset")

rs.open "SELECT * FROM myTable", conn

for each x in rs.fields

response.write x & "<br>" & vbNewLine

next

%>
</body>
</html>
Jun 14 '07 #36
jhardman
3,406 Expert 2GB
dns= webice
access document= dbo_sutherlands_mailing_list
fields needed to be added in are, email, store_num

I put this code in the tester
<%

set conn=Server.CreateObject("ADODB.Connection")

conn.Open "dbo_sutherlands_mailing_list"

set rs = server.createObject("ADODB.recordset")

rs.open "SELECT * FROM myTable", conn

for each x in rs.fields

response.write x & "<br>" & vbNewLine

next

%>
try this in tester.asp:
Expand|Select|Wrap|Line Numbers
  1. <% dim conn, rs
  2.       set conn=Server.CreateObject("ADODB.Connection")
  3.       conn.Provider="Microsoft.Jet.OLEDB.4.0"
  4.       conn.Open "c:/inetpub/sutherlands_mailing_list.mdb" 'make sure you have the full path name
  5.       set rs = server.createObject("ADODB.recordset")
  6.       rs.open "SELECT * FROM dbo_sutherlands_mailing_list", conn
  7.       for each x in rs.fields
  8.          response.write x & "<br>" & vbNewLine
  9.       next
  10.       %>
Jun 14 '07 #37
*dunno if it helps but iam working "remotely " on the server, its not on my pc
Jun 14 '07 #38
not working :




Microsoft JET Database Engine error '80004005'

Could not find file 'c:\windows\system32\inetsrv\dbo_sutherlands_maili ng_list.mdb'.

/tester.asp, line 18


why is it trying to access system 32 files?
Jun 14 '07 #39
jhardman
3,406 Expert 2GB
not working :




Microsoft JET Database Engine error '80004005'

Could not find file 'c:\windows\system32\inetsrv\dbo_sutherlands_maili ng_list.

/tester.asp, line 18


why is it trying to access system 32 files?
What is the exact file path for the db file? that's what needs to go in the line with
conn.open "...
you also might be able to try
conn.open server.mapPath("dbo_sutherlands_mailing_list.mdb")
This just asks the server to look up the exact file path, but sometimes the server needs hints...

Jared
Jun 14 '07 #40
still not working, strong feeling of da ja vu and i get fired tomarrow, Weird feeling....lawl i hope i dont.....


well thanks for your help man, I will get on here later tonight just to say hey,


I got to go home now
Jun 14 '07 #41
improvcornartist
303 Expert 100+
Also, if you are trying to access a database on a different server, you may have to directly specify the server. For instance: conn.open "\\servername\directory\file.mdb"

If this is the case, you may also have to check permissions to the database.
Jun 14 '07 #42
crap i got banned?

what for?
Jun 15 '07 #43
Oke dokey, i did as improvcornartist said , and it seems to be working better,

now it says
Microsoft JET Database Engine error '80004005'

Not a valid file name.

Soo....at least its connecting to the server
Jun 15 '07 #44
my boss emailed me this

you're connecting to a table on the SQL server, which is called sutherlands_mailing_list, not an access database. Look at the data entry pages on www.sutherlandshomedesigncenter.com/manager to see how to connect. Your connection string is already built if you use the file include 'database_connect' - you basically just have to write a simple SQL INSERT statement.
Jun 15 '07 #45
improvcornartist
303 Expert 100+
Can you connect to the database using the include file?
Jun 15 '07 #46
jhardman
3,406 Expert 2GB
my boss emailed me this

you're connecting to a table on the SQL server, which is called sutherlands_mailing_list, not an access database. Look at the data entry pages on www.sutherlandshomedesigncenter.com/manager to see how to connect. Your connection string is already built if you use the file include 'database_connect' - you basically just have to write a simple SQL INSERT statement.
I'm still confused between 1- what is the name of the db file 2- what is the name of the dsn 3- what is the name of the table? I guess if this is on sql server than you really need to know 2 and 3 and you need to connect using the dsn.

What do the magical files on /manager say?

By the way, I looked into the problem with being banned. The mod who banned you has not yet responded.

Jared
Jun 15 '07 #47
jhardman
3,406 Expert 2GB
my boss emailed me this

you're connecting to a table on the SQL server, which is called sutherlands_mailing_list, not an access database. Look at the data entry pages on www.sutherlandshomedesigncenter.com/manager to see how to connect. Your connection string is already built if you use the file include 'database_connect' - you basically just have to write a simple SQL INSERT statement.
Actually, now that makes a lot of sense. The connection command is in the include file, so your boss doesn't even know what the dsn is. I'm afraid you will have to use the include file and follow the lead of the other data entry pages.

I would like to caution, however, to not use "INSERT". There are a lot of things that can happen to cause an ado connection to error, and if you split up the insert command into "SELECT", "addnew", and "update" this will give you a better idea where a problem is if and when you find one.

This would go something like this:
Expand|Select|Wrap|Line Numbers
  1. query = "SELECT * FROM sutherlands_mailing_list"
  2. rs.open query, conn, 2, 3
  3.  
  4. rs.addnew
  5. for each x in rs.fields
  6.    if request.form(x) <> "" then
  7.       rs(x) = request.form(x)
  8.    end if
  9. next
  10. rs.update
Let me know if this helps.

Jared

(by the way, thank you for getting me my 500th post)
Jun 15 '07 #48
hey thanks guys got it working! woot, thanks for your help it has a diffrent address than before,

ALSO

why did i get banned, ne one know?

http://www.webice.net/join.asp
Jun 15 '07 #49
jhardman
3,406 Expert 2GB
why did i get banned, ne one know?
I couldn't find a reason. The mod who banned you did post in one thread with you, it was a non-technical thread, I think in the games and puzzles forum. I pm'd him and didn't get a response.

I think it was probably on accident though, because every offense I can think of that would warrant a permanent ban also requires that at least some posts be deleted. See any posts deleted?

Jared
Jun 15 '07 #50

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Christopher J. Hahn | last post by:
I'm trying to use a script-generated form to submit to a script-generated iframe. The problem I'm running into is that the iframe is not assuming the name I assign it. IE6 on Win2000. FF1.0.2+...
2
by: MLH | last post by:
A form named frmVehicleEntryForm has a number of textbox controls who's OnGotFocus property setting is an expression... =Change2Green() Change2Green() looks something like this... Dim MyControl...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
3
by: Mark Rae | last post by:
Hi, Just a general quickie on setting properties of user controls from the parent form. Let's say I have a user control called note.ascx which displays a datagrid. That datagrid is populated...
1
by: DBC User | last post by:
I came across the application setting feature today and it is pretty cool. I would like to know if someone can help me in the following situation. In my current project, On form closing I take the...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
7
by: Academic | last post by:
What are the different effects of the following two statements: C1.Cursor = Cursors.WaitCursor C1.Cursor.Current = Cursors.WaitCursor I believe the first replaces the entire C1.Cursor...
0
by: iceborg | last post by:
Greetings, I have an application that was originally designed in Access 2000. It has been transformed to Access 2002 (XP), Access 2003, and now Access 2007. I have a form and subform, the...
8
by: Andrus | last post by:
..NET 2 Winforms application. How to create new setting and set it default value in userSettings section of app.config file or overwrite existing setting value ? I found code below in this list...
7
by: PetterL | last post by:
I have a setting called My.settings.firstrun set to True, set in the setting manager. When i read this in the first form form_Load in a IF sentence it always come out as false. I have tried to...
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
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...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.