Below is my source code for a questionnaire I created using HTML and ASP. It contains radio buttons for the selections. I coded it using ASP and HTML. However, when I click the submit button the selections made by user are not displayed on the screen. What am I missing?

HTML code::

<html>
<h1><STRONG><var>eLMS </var>Helpdesk</STRONG></h1>
<form>
<!--<td><STRONG>Dear<%=cookie.username%></STRONG><br>-->
<td><STRONG>You recently sent an email to the <var>eLMS </var>Helpdesk regarding a concern or problem you experienced with the new <var>eLMS</var> ( Learning Management System ).   Please complete this Customer Satisfaction Survey concerning the service you were provided.</STRONG><br>
</td></tr></form>
<!--<form method="post" action="processform.asp">  -->
<form method="post" action="C:\Documents and Settings\Administrator.ARC00WN82534000\Desktop\eLMS FORM1\eLMS feedback form\eLMS_feedback_form_process.html">
<table border="1" bgcolor="#98AFC7">
<tr>
<td align="center">
<br>    <br>
<blockquote>
<!--First Name: <input type="text" size="25" name="f1"><br> 
Last Name: <input type="text" size="25" name="f2"><br>-->

<br>
<DIV align="center "><TABLE>
<br>
<STRONG>What was your reason for contacting the <var>eLMS</var> Help Desk? 
 </STRONG>
<br>




<input type="radio" name = "reason" value = "0"> Unable to login to eLMS<br>
<input type="radio" name = "reason" value = "1">Unable to connect to eMLS login page<br>
<input type="radio" name = "reason" value = "2">Password reset request<br>
<input type="radio" name = "reason" value = "3">Unable to launch course<br>
<input type="radio" name = "reason" value = "4">Course progress is not being saved<br>
<input type="radio" name = "reason" value = "5">Unable to print report or completion certificate<br>
<input type="radio" name = "reason" value = "6">Received e-mail message concerning Learning Expiration Notification<br>
<input type="radio" name = "reason" value = "7">Other<br>


<br>
<STRONG>How long did it take to get a response to your e-mail?</STRONG><br>



<input type="radio" name = "response" value = "0">Under 1 hour<br>
<input type="radio" name = "response" value = "1">2 - 6 hours<br>
<input type="radio" name = "response" value = "2">6 - 12 hours<br>
<input type="radio" name = "response" value = "3">1 business day<br>
<input type="radio" name = "response" value = "4">More than 1 business day<br>
<input type="radio" name = "response" value = "5">They did not reply to my e-mail<br>




<br>
<STRONG>Was your problem or issue resolved?</STRONG><br>



<input type="radio" name = "resolved" value = "0">Yes<br>
<input type="radio" name = "resolved" value = "1">No<br>






<br>
<STRONG>Overall, how would you rate your customer service experience?</STRONG><br>



<input type="radio" name = "rate" value = "0">Very Satisfied<br>
<input type="radio" name = "rate" value = "1">Satisfied<br>
<input type="radio" name = "rate" value = "2">Neutral<br>
<input type="radio" name = "rate" value = "3">Unsatisfied<br>
<input type="radio" name = "rate" value = "4">Extremely unsatisfied<br>

</TABLE>


</DIV>

<br><STRONG>Do you have any comments or suggestions that would help us improve our eLMS customer service?   </STRONG>

<textarea name="comments" rows="5" cols="50">
</textarea><br><br>


<input type="submit" value="SUBMIT" name="action">
<input type="reset" value="RESET">
<!--<a href="C:\Documents and Settings\Administrator.ARC00WN82534000\Desktop\FAA eLMS feedback formradio.html">Feedback</a></font></p> -->
</blockquote>
<br>

end of HTML code.


ASP code::

<html>
<head>

<title>
  eLMS Feedback Form Process
</title>



<body bgcolor = "white">

<h1>
FORM OUTPUT
</h1>

<blockquote>

	<b>  Reason for contacting:</b> <%=Request.Form("reason")%> <br><br>

		<blockquote>
			<%
				theCount = Request.Form.Count
					For i = 0 to theCount
						Response.Write("<b>"& i & " - " & Request.Form(i) & "</b><br>")
					Next 
			%>
		</blockquote>

 	<b>  Response Time:</b> <%=Request.Form("response")%> <br><br>

		<blockquote>
			<%
				theCount = Request.Form.Count
					For i = 0 to theCount
						Response.Write("<b>"& i & " - " & Request.Form(i) & "</b><br>")
					Next 
			%>
		</blockquote>

	<b>  Issue Resolved:</b> <%=Request.Form("resolved")%> <br><br>

		<blockquote>
			<%
				theCount = Request.Form.Count
					For i = 0 to theCount
						Response.Write("<b>"& i & " - " & Request.Form(i) & "</b><br>")
					Next 
			%>
		</blockquote>


	<b>  Rate Service:</b> <%=Request.Form("rate")%> <br><br>

		<blockquote>
			<%
				theCount = Request.Form.Count
					For i = 0 to theCount
						Response.Write("<b>"& i & " - " & Request.Form(i) & "</b><br>")
					Next 
			%>
		</blockquote>

	

	<b>  Comments: </b>  <%=Request.Form("comments")%> <br><br><br>

</blockquote>


<hr>


</html>

</head>

end of ASP code::

Recommended Answers

All 31 Replies

You wanna use this form action

<!--<form method="post" action="processform.asp">  -->

instead of this

<form method="post" action="C:\Documents and Settings\Administrator.ARC00WN82534000\Desktop\eLMS FORM1\eLMS feedback form\eLMS_feedback_form_process.html">

I'm not sure excatly what you're trying to do, but if you want to loop through the radio buttons it should be like this:

theCount = Request.Form.Count
For i = 1 to theCount-1
Response.Write("<b>"& i & " - " & Request.Form(i) & "</b><br>")
Next

But itsn't want you're trying to do really smth like:
html code:

<input type="radio" name = "reason" value = "unable"> Unable to login to eLMS<br>
<input type="radio" name = "reason" value = "Unable to connect to eMLS login page">Unable to connect to eMLS login page<br>
<input type="radio" name = "reason" value = "Password reset request">Password reset request<br>
<input type="radio" name = "reason" value = "Unable to launch course">Unable to launch course<br>
<input type="radio" name = "reason" value = "Course progress is not being saved">Course progress is not being saved<br>
<input type="radio" name = "reason" value = "Unable to print report or completion certificate">Unable to print report or completion certificate<br>
<input type="radio" name = "reason" value = "Received e-mail message concerning Learning Expiration Notification">Received e-mail message concerning Learning Expiration Notification<br>
<input type="radio" name = "reason" value = "Other">Other<br>


"....and so on"

asp code:

<b>  Reason for contacting:</b> <%=Request.Form("reason")%> <br><br>
<b>  Response Time:</b> <%=Request.Form("response")%> <br><br>
<b>  Issue Resolved:</b> <%=Request.Form("resolved")%> <br><br>

"....and so on"

I tried that but it still does not display the infomation selected by the user(s). I also switched it to processform.asp but still same results, No display.

OK...check out the attached file.

I've edited it to do what I think you need it to do (?).
It works for me on IIS.

I will try it and let you know what happens.

Thanks

So Madmittal,

When you click Submit button does the next page display the radio buttons statements that were selected and the comments that were keyed in.

Yes.

Something like:

FORM OUTPUT
Reason for contacting: Unable to launch course

Response Time: 1 business day

Issue Resolved: Yes

Rate Service: Unsatisfied

Comments: blah

You get smth else?

Yes I am only getting the header display. No radio value buttons displayed. I am going to check and make sure my computer is running on IIS but I thought I followed the directions pretty well. Exactly what are those single quote parenthesis ( ' )on the left side of the code for?

Good idea...if you don't get an output like above smth is wrong.

The (') in front of a line means that the line is not executed. It's the equivilant of (//) in JavaScript....

Well someone stated that it must run on a server. I thought I setup my desktop with IIS configurations. The steps I used to install IIS are as follows:

1. Open control panel
2. Go to add/remove programs then go to add window components
3. Highlight Internet Information Services
4. Click details then check every box in window.
5. Click next then follow instructions and insert disk of Windows XP when asked.

Is this correct or am I missing something?

That's correct.
When the installation is complete you should have a new directory on your hard disk where Windows is installed called 'Inetpub'.
Assuming your Windows installation hard drive is 'C:' you go to 'C:\Inetpub\wwwroot\', and place your asp files here.
Then in an Internet Explorer you type in the address 'localhost/file-name.asp' (say you want to run a file called '02.asp' type 'localhost/02.asp').

If you make a new directory in the 'Inetpub\wwwroot\' folder (say the dir is called 'tests'), they right-click the dir and choose 'Properties', go to the 'Web Sharing' tab and click 'Share this folder'. It'll prompt you for an alias, no need to change this from the dir name. Click Ok, and then you can reference the dir in Internet Explorer 'localhost/tests/file-name.asp'.

Am I also suppose to place the html file inside the 'C:\Inetpub\wwwroot\' folder with the asp file?

I got it to work. thanks a lot.

What I don't understand is why can't I just click the html document link inside the wwwroot folder and it work that way. Instead I have to open internet explorer and do the local host bit.

Great...I'm glad you got it to work (finally :p )

And yes, as you figured out for yourself, all files go in the 'wwwroot' folder.


Running your code by pointing IE to 'localhost/some-file' openes the file (of course) but also tells Windows to run it through the IIS, which in turn interprets the asp code and outputs it as html.

Double clicking the file openes IE to the address of 'C:\inetpub\wwwroot\some-file', but this way the file is processed only by IE itself....and IE doesn't understand asp, as you know.

'that make sence?

Happy huntin' :cheesy:

Okay, I have created this survey. My next step is to create a table in MS Access that holds the records of data when user submit the survey. I created a blank table with five columns as follows: response, reason, rate, comments and resolved. Can someone point me in the direction I need to go to read and write to the table from the questionnaire that was created using ASP? Or do I have other steps I need to complete first? Any direction would be appreciated.

You'll need a primary key in your table - a column that has unique values. A integer 'ID' column with auto incrementation will do.

To write data to your Access DB you do smth like

<%
'Dimension variables
Dim adoCon 		'Holds the Database Connection Object
Dim strSQL		'Holds the SQL query for the database


Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object
adoCon.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("database_name.mdb")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "INSERT INTO table_name VALUES('', '" & Request.Form("reason") & "', '" & Request.Form("response") & "', '" & Request.Form("resolved") & "', '" & Request.Form("rate") & "', '" & Request.Form("comments") & "');"

'the "blank" data value ( '' ) is intented for an "auto value" field like and id auto increment column.
'Using this method the number of values in the strSQL string must be the same as the number of columns in the table.

'insert new data into table
adoCon.Execute strSQL

'Reset server objects
Set adoCon = Nothing

'Redirect to some page page
Response.Redirect "thanks.htm"
%>

To get data from table

<%
'Dimension variables
Dim adoCon 		'Holds the Database Connection Object
Dim rsData		'Holds the recordset for the new record to be added to the database
Dim strSQL		'Holds the SQL query for the database


Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object
adoCon.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("database_name.mdb")

'Create an ADO recordset object
Set rsData = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM table_name;"

'Open the table using the SQL query held in the strSQL varaiable
rsData.Open strSQL, adoCon

'Loop through recordset lines
Do While Not rsData.EOF
'output
Response.Write rsData("reason") & " - " & rsData("response") & " - " & rsData("resolved") & " - " & rsData("rate") & " - " & rsData("comments") & "<BR>"

rsData.MoveNext   'Move to next record
Loop

'Reset server objects
rsData.Close
Set rsData = Nothing
Set adoCon = Nothing

%>

A better database solution is mySQL, which can be installed on your pc to work with IIS.
You can download from http://www.mysql.com
You'll also need an odbc connector (also available from mysql.com). Even if you don't want to run mySQL at this point, you may still find the mySQL manual of some use since the sql syntax is the same as with Access.

I am suppose to use Microsoft Access for now. I think after I finish this project I will be using Oracle database not sure.
What does this statment mean?

PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE.

I tried to find it in my ASP book but no luck. Also, does VB script use semi-colons because there are a couple of lines of code that have them and I did not think VBScript and ASP used semicolons.

Appreciate the comments in the code helps out alot for some of the parts that I can understand.

The statement tells the asp interpreter which database is being used and where to find the database file.

it could also look like:
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database_name.mdb")

You're right; vbscript doesn't use semicolons. But the semicolons are only in the SQL strings, so actually they're not part of the vbscript but interpretet only by the database connector.

As far as I remeber the semicolon isn't even mandatory in connecting to Access DB's.....but I'm not sure (I always use mySQL). Anyway it's a habit for me to put them in 'cause when working with the mySQL "interfase" they are in fact mandatory.

Okay. Lets take this step by step to make sure I am doing this right. This is all a learning experiment project for me. It has no time committments. So I am given a piece of paper,and asked to create this questionnaire so that feedback will be received and evaluated by management team.

First step: Create the questionnaire in html.
Second step: Write the code in ASP to get information back from client.
Third Step: Create a table in Access to capture the feedback sent back from the client. This table consists of six columns which include the names( reason,response,rate,resolved and comments), and primary key. Fourth: Write the code in ASP to read and write information from questionnaire to the table.
Fifth: Task Complete.


Does this sound like the steps needed to complete this task.

Question: The database name for the statement below would that be Microsoft Access, the file name of the table or something else? Or is it the name you give when you set up the DSN?

Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("database_name.mdb")

Question: How do you know which method to use or have to use between OLE DB or ODBC to connect to a database?

Question: When I try to create the DSN, when I decide to Windows NT authentication or SQL server, either way I receive an error connection failed, any ideas why? I am using Windows XP professional.

First step: Create the questionnaire in html.
Second step: Write the code in ASP to get information back from client.
Third Step: Create a table in Access to capture the feedback sent back from the client. This table consists of six columns which include the names( reason,response,rate,resolved and comments), and primary key. Fourth: Write the code in ASP to read and write information from questionnaire to the table.
Fifth: Task Complete.

Does this sound like the steps needed to complete this task.

Well, yes. Step two is kinda redundant because the data is sent to server upon submitting the form either way. But other than that those are the steps you need.

(1)Question: The database name for the statement below would that be Microsoft Access, the file name of the table or something else? Or is it the name you give when you set up the DSN?

Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("database_name.mdb")


(2)Question: How do you know which method to use or have to use between OLE DB or ODBC to connect to a database?

(3)Question: When I try to create the DSN, when I decide to Windows NT authentication or SQL server, either way I receive an error connection failed, any ideas why? I am using Windows XP professional.

(1)The "database_name" in the statement is the name of the actual Access database file (notice the extension). If you place your database file in a folder other that the one holding your asp files, folder names should be included here as well (eg. ("workdir/data/database_name.mdb") ).
(2) I'm not sure I even know that, but I guess it's database dependent.
(3) Don't think I understand the question. The connection string object used in the previously posted code is a non-DSN connection. There should no need to setup additional things to make it run.
I never use DSN connections my self, so I'm not that familiar with it.

If you want to use a DSN connection you can setup a user DSN on your computer through Control Panel -> Administrative Tools -> Data Sources (ODBC)
And then smth like (adoCon.Open "DSN=name_of_your_dsn_connection") should suffice as your connection object string.
Or you can always try Google (Google is our friend :cheesy: ) or maybe http://www.iisanswers.com

I keep getting an error message. This is the error message I keep receiving when trying to submit the questionnaire. I also placed the code for the asp part of the questionnaire again below. My access file is in a folder named eLMS Table 1 and the file name is eLMS Database Table.

Error Type:
Microsoft VBScript compilation (0x800A0411)
Name redefined
/eLMS/processform.asp, line 108, column 4
Dim adoCon <!--Holds the Database Connection Object-->
---^


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) 

Page:
POST 131 bytes to /eLMS/processform.asp

POST Data:
reason=Unable+to+login+to+eLMS&response=They+did+not+reply+to+my+e-mail&resolved=No&rate=Very+Satisfied&comments=What&action=SUBMIT 

Time:
Tuesday, August 23, 2005, 10:53:35 AM 


More information:
Microsoft Support

:?:

<html>
<head>

<body>
<title>
  eLMS Feedback Form Process
</title>



<body bgcolor = "white">

<hr>
<h1>
eLMS Survey
</h1>

<blockquote>

	<b>  Reason for contacting:</b> <%=Request.Form("reason")%> <br><br>


 		
	
 	<b>  Response Time:</b> <%=Request.Form("response")%> <br><br>

		


	<b>  Issue Resolved:</b> <%=Request.Form("resolved")%> <br><br>

		

	<b>  Rate Service:</b> <%=Request.Form("rate")%> <br><br>

		
	

	<b>  Comments: </b>  <%=Request.Form("comments")%> <br><br><br>

</blockquote>



<!--The following code writes data to the Microsoft Access database -->
<%

	<!--DIMENSION VARIABLES-->
	Dim adoCon		<!-- HOLDS THE DATABASE CONNECTION OBJECT-->     
	Dim strSQL		<!-- HOLDS THE SQL QUERY FOR THE DATABASE-->



	Set adoCon  = Server.CreateObject("ADODB.Connection")


	<!-- SET AN ACTIVE CONNECTION TO THE CONNECTION OBJECT-->

		adoCon.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=C:\eLMS Table 1\eLMS Database Table " & Server.MapPath("eLMS Table 1\eLMS Database Table.mdb")




	<!--the "blank" data value ( '' ) is intented for an "auto value" field like and id auto increment column.-->
	<!--Using this method the number of values in the strSQL string must be the same as the number of columns in the table.-->
	<!--Initialize the strSQL variable with an SQL statement to query the database-->
	
		strSQL = "INSERT INTO eLMS Table 1 VALUES('', '" & Request.Form("reason") & "', '" & Request.Form("response") & "', '" & Request.Form("resolved") & "', '" & Request.Form("rate") & "', '" & Request.Form("comments") & "');"




	
	<!--insert new data into table-->
	
		adoCon.Execute strSQL


	<!--Reset server objects-->

		Set adoCon = Nothing


	<!--Redirect to some page -->
		
		Response.Redirect " thanks.htm"


%>
 <!--The end of the code for writing to the Microsoft Access Database-->





 <!--The following code is for reading data from the Microsoft Access Database file-->
<%		


	<!--Dimension variables-->

		Dim adoCon		<!--Holds the Database Connection Object-->
		Dim rsData		<!--Holds the recordset for the new record to be added to the database-->
		Dim strSQL		<!--Holds the SQL query for the database-->


		Set adoCon = Server.CreateObject("ADODB.Connection")

	
	<!--Set an active connection to the Connection object-->

		adoCon.Open " PROVIDER=MICROSOFT.Jet.OLEDB.4.0;DATA SOURCE=C:\eLMS Table 1" & Server.MapPath("eLMS Table 1\eLMS Database Table.mdb")

	<!--Create an ADO recordset object-->

		Set rsData = Server.CreateObject("ADODB.Recordset")

	<!-- Initialize the strSQL variable with an SQL statement to query the database-->

		strSQL = "SELECT * FROM BloomerDatabase; "  <!-- Name of the system ODBC that I created -->

	<!-- Open the table using the SQL query held in the strSQL variable-->

		rsData.Open strSQL, adoCon

	 <!-- Loop through recordset lines-->

		Do While Not rsData.EOF
		
	 <!--Output-->

		Response.Write rsData("reason") & " - " & rsData("response") & " - " & rsData("resolved") & " - " & rsData("rate") & " - " & rsData("comments") & "<BR>"

	 <!-- Move to next record-->

		rsData.MoveNext	
		
		Loop

	 <!--Reset server objects-->

		rsData.Close
	
		Set rsData = Nothing
		Set adoCon = Nothing

%> 
 <!-- End of code for reading from Microsoft Access Database Table -->
	 
	
	



	

</body>
</html>

</head>

:?:

I deleted the code for reading from the database. I don't think I need that part of the code in their for reading to a database since I am only writing to the access database. Now this is the error message below:

Technical Information (for support personnel)

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Not a valid file name.
/eLMS/processform.asp, line 67


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) 

Page:
POST 161 bytes to /eLMS/processform.asp

POST Data:
reason=Received+e-mail+message+concerning+Learning+Expiration+Notification&response=2+-+6+hours&resolved=No&rate=Extremely+unsatisfied&comments=vvv&action=SUBMIT 

Time:
Tuesday, August 23, 2005, 1:26:17 PM 


More information:
Microsoft Support

Error Type:
Microsoft VBScript compilation (0x800A0411)
Name redefined
/eLMS/processform.asp, line 108, column 4
Dim adoCon <!--Holds the Database Connection Object-->
---^

This means that you have dimensioned the same variable name twice.
You've dimensioned the variable both in the read and write part of the code. Only dimension variables once.

As for

[Microsoft][ODBC Microsoft Access Driver] Not a valid file name.
/eLMS/processform.asp, line 67

That is an error in you connection string....
It should only be

Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("eLMS Table 1\eLMS Database Table.mdb")

Also, maybe the blank spaces in file and folder names could be a problem....but can't say for sure....

I will check the connection out tomorrow at work and let you know but I thought the variable declarations were only availiable within that scope but now I know.

This is the error message I am receiving now. Someone told me to check to make sure that they have permission for that folder. So I went to the inetpub and elms folders and allowed web sharing for those folders but still received same error message. I am going to keep at it. I posted the error code and html/asp code below.


This is the error code. :sad:

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft JET Database Engine (0x80004005)
'C:\Inetpub\wwwroot\eLMS\eLMS Table 1\eLMS Database Table.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
/eLMS/processform.asp, line 65


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) 

Page:
POST 156 bytes to /eLMS/processform.asp

POST Data:
reason=Received+e-mail+message+concerning+Learning+Expiration+Notification&response=6+-+12+hours&resolved=No&rate=Satisfied&comments=tuyjtyujt&action=SUBMIT 

Time:
Thursday, August 25, 2005, 11:49:15 AM 


More information:
Microsoft Support

This is the ASP code.

<html>
<head>

<body>
<title>
  eLMS Feedback Form Process
</title>



<body bgcolor = "white">

<hr>
<h1>
eLMS Survey
</h1>

<blockquote>

	<b>  Reason for contacting:</b> <%=Request.Form("reason")%> <br><br>


 		
	
 	<b>  Response Time:</b> <%=Request.Form("response")%> <br><br>

		


	<b>  Issue Resolved:</b> <%=Request.Form("resolved")%> <br><br>

		

	<b>  Rate Service:</b> <%=Request.Form("rate")%> <br><br>

		
	

	<b>  Comments: </b>  <%=Request.Form("comments")%> <br><br><br>

</blockquote>



<!-- The following code writes data to the Microsoft Access database -->
<%

	<!--DIMENSION VARIABLES-->
	Dim adoCon		<!-- HOLDS THE DATABASE CONNECTION OBJECT-->     
	Dim strSQL		<!-- HOLDS THE SQL QUERY FOR THE DATABASE-->



	Set adoCon  = Server.CreateObject("ADODB.Connection")


	<!-- SET AN ACTIVE CONNECTION TO THE CONNECTION OBJECT-->

			adoCon.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("eLMS Table 1\eLMS Database Table.mdb")

		 <!-- 	adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\eLMS Table 1\eLMS Database Table" & Server.MapPath("eLMS Table 1\eLMS Database Table.mdb") -->



	<!--the "blank" data value ( '' ) is intented for an "auto value" field like and id auto increment column.-->
	<!--Using this method the number of values in the strSQL string must be the same as the number of columns in the table.-->
	<!--Initialize the strSQL variable with an SQL statement to query the database-->
	
		strSQL = "INSERT INTO eLMS Table 1 VALUES('', '" & Request.Form("reason") & "', '" & Request.Form("response") & "', '" & Request.Form("resolved") & "', '" & Request.Form("rate") & "', '" & Request.Form("comments") & "');"




	
	<!--insert new data into table--> 
	
		adoCon.Execute strSQL


	<!--Reset server objects-->

		Set adoCon = Nothing


	<!--Redirect to some page -->
		
		Response.Redirect " thanks.htm"


%>
 <!--The end of the code for writing to the Microsoft Access Database-->




	

</body>
</html>

</head>

I created a new table in access and stored the file eLMSTable in the inetpub/wwwroot folder (inetpub/wwwroot/eLMSTable) and this is the error message I am receiving now. Doesn't seem like I have a connection error but a problem accessing the table. Not sure.


This is the error message.

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft JET Database Engine (0x80040E37)
Could not find output table 'eLMS'.
/eLMS/processform.asp, line 83


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) 

Page:
POST 123 bytes to /eLMS/processform.asp

POST Data:
reason=Course+progress+is+not+being+saved&response=1+business+day&resolved=No&rate=Satisfied&comments=gbdfbgf&action=SUBMIT 

Time:
Thursday, August 25, 2005, 4:28:28 PM 


More information:
Microsoft Support

This is the asp code here:

<html>
<head>

<body>
<title>
  eLMS Feedback Form Process
</title>



<body bgcolor = "white">

<hr>
<h1>
eLMS Survey
</h1>

<blockquote>

	<b>  Reason for contacting:</b> <%=Request.Form("reason")%> <br><br>


 		
	
 	<b>  Response Time:</b> <%=Request.Form("response")%> <br><br>

		


	<b>  Issue Resolved:</b> <%=Request.Form("resolved")%> <br><br>

		

	<b>  Rate Service:</b> <%=Request.Form("rate")%> <br><br>

		
	

	<b>  Comments: </b>  <%=Request.Form("comments")%> <br><br><br>

</blockquote>



<!-- The following code writes data to the Microsoft Access database -->
<%

	<!--DIMENSION VARIABLES-->
	Dim adoCon		<!-- HOLDS THE DATABASE CONNECTION OBJECT-->     
	Dim strSQL		<!-- HOLDS THE SQL QUERY FOR THE DATABASE-->



	Set adoCon  = Server.CreateObject("ADODB.Connection")


	<!-- SET AN ACTIVE CONNECTION TO THE CONNECTION OBJECT-->

			adoCon.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("eLMSTable.mdb")

		 <!-- 	adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\eLMS Table 1\eLMS Database Table" & Server.MapPath("eLMS Table 1\eLMS Database Table.mdb") -->



	<!--the "blank" data value ( '' ) is intented for an "auto value" field like and id auto increment column.-->
	<!--Using this method the number of values in the strSQL string must be the same as the number of columns in the table.-->
	<!--Initialize the strSQL variable with an SQL statement to query the database-->
	
		strSQL = "INSERT INTO eLMS VALUES('', '" & Request.Form("reason") & "', '" & Request.Form("response") & "', '" & Request.Form("resolved") & "', '" & Request.Form("rate") & "', '" & Request.Form("comments") & "');"




	
	<!--insert new data into table--> 
	
		adoCon.Execute strSQL


	<!--Reset server objects-->

		Set adoCon = Nothing


	<!--Redirect to some page -->
		
		Response.Redirect " thanks.htm"


%>
 <!--The end of the code for writing to the Microsoft Access Database-->


<!--The following code is for reading data from the Microsoft Access Database file-->
<%		


	<!--Dimension variables-->

		Dim rsData		<!--Holds the recordset for the new record to be added to the database-->
		


		Set adoCon = Server.CreateObject("ADODB.Connection")

	
	<!--Set an active connection to the Connection object-->

		adoCon.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("eLMSTable.mdb")

		<!-- adoCon.Open " PROVIDER=MICROSOFT.Jet.OLEDB.4.0;DATA SOURCE=C:\eLMS Table 1" & Server.MapPath("eLMS Table 1\eLMS Database Table.mdb") -->


	<!--Create an ADO recordset object-->

		Set rsData = Server.CreateObject("ADODB.Recordset")


	<!-- Initialize the strSQL variable with an SQL statement to query the database-->

		strSQL = "SELECT * FROM BloomerDatabase; "  <!-- Name of the system ODBC that I created -->


	<!-- Open the table using the SQL query held in the strSQL variable-->

		rsData.Open strSQL, adoCon


	 <!-- Loop through recordset lines-->

		Do While Not rsData.EOF

		
	 <!--Output-->

		Response.Write rsData("reason") & " - " & rsData("response") & " - " & rsData("resolved") & " - " & rsData("rate") & " - " & rsData("comments") & "<BR>"


	 <!-- Move to next record-->

		rsData.MoveNext	

		
		Loop


	 <!--Reset server objects-->

		rsData.Close
	
		Set rsData = Nothing
		Set adoCon = Nothing

%> 
 <!-- End of code for reading from Microsoft Access Database Table -->
	 
	
	


	

</body>
</html>

</head>

Yeah.
Looks like your connection string is correct now.

The error msg suggests you're trying to write data to a table that doesn't exist. Is there a table in eLMSTable.mdb called eLMS?

:) It works now. Had to do with path with the access table I created.

Thanks very much. :D

You're welcome...and thanx for letting me know.
You get that "YES!"-feeling :cool: when it FINALLY works, right? :)
Hope you picked up some general ideas for future work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.