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
52 4432
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: - <%
-
for each x in request.form
-
response.write x & ": " & request.form(x) & "<br>" & vbNewLine
-
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?
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
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.
^
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
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 -
<!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>Untitled Document</title>
-
</head>
-
-
<body> 1.
-
<%
-
2.
-
for each x in request.form
-
3.
-
response.write x & ": " & request.form(x) & "<br>" & vbNewLine
-
4.
-
next %>
-
</body>
-
</html>
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)
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 %>
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
Oke dokey, I put in the new code in the tester.asp File, replacing the old, next step?
Nope, it doesnt display just takes me back to a blank form,
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?
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" ...>
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*
it says
<form id="form1" name="form1" method="post" action="tester.asp">
i canged it to <form action="tester.asp" ...>
And it takes me to tester, but the page is blank
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
oke dokey got it working, it shows, but does not save
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:
instead of
Jared
oke dokey got it working, it shows, but does not save
good, I see it too. What are your thoughts on the db?
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
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 ^.^;
But we run off a SQL serv...does that help?
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
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
and we use MS access to update stuff
found the mailing list she was talking about....huge-the access document
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
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
crunch time, less than a hour to get it done T.T *CRYS
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
the name of the DNS is webice, and the access sheet name is
dbo_sutherland_mailing_list
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: - <% dim conn, rs
-
set conn=Server.CreateObject("ADODB.Connection")
-
conn.Provider="Microsoft.Jet.OLEDB.4.0"
-
conn.Open "c:/inetpub/sutherlands_mailing_list.mdb"
-
set rs = server.createObject("ADODB.recordset")
-
rs.open "SELECT * FROM myTable", conn
-
for each x in rs.fields
-
response.write x & "<br>" & vbNewLine
-
next
-
%>
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: - <%
-
set conn=Server.CreateObject("ADODB.Connection")
-
conn.Open "sutherlands_mailing_list"
-
set rs = ...
-
the rest is the same
Try this and see if it works
Jared
which document does that go in ,tester?
and the DNS is webice where does that go?
ty again for all this
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
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>
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: - <% dim conn, rs
-
set conn=Server.CreateObject("ADODB.Connection")
-
conn.Provider="Microsoft.Jet.OLEDB.4.0"
-
conn.Open "c:/inetpub/sutherlands_mailing_list.mdb" 'make sure you have the full path name
-
set rs = server.createObject("ADODB.recordset")
-
rs.open "SELECT * FROM dbo_sutherlands_mailing_list", conn
-
for each x in rs.fields
-
response.write x & "<br>" & vbNewLine
-
next
-
%>
*dunno if it helps but iam working "remotely " on the server, its not on my pc
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?
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
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
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.
crap i got banned?
what for?
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
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.
Can you connect to the database using the include file?
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
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: - query = "SELECT * FROM sutherlands_mailing_list"
-
rs.open query, conn, 2, 3
-
-
rs.addnew
-
for each x in rs.fields
-
if request.form(x) <> "" then
-
rs(x) = request.form(x)
-
end if
-
next
-
rs.update
Let me know if this helps.
Jared
(by the way, thank you for getting me my 500th post)
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
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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+...
|
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...
|
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...
|
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...
|
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...
|
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"...
|
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...
|
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...
|
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...
|
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...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
| |