Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 3rd, 2006, 01:56 PM
Registered User
 
Join Date: Feb 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Writing Variables to an access database

Good morning,

I am very new to asp and database connections.

I'm trying to take a set of variables and write them to an access 2000 database. My database name, table name, variable and table column names are all correct as far as I can tell, but when I try to post the data to the database I get the following error:

Unable to post test data to host, cannot submit results! Server returned HTTP response code: 500 for URL: http://numdet01/courses/test/iron/submit.asp

The http path above is the correct path to the submit.asp file. Below is the text from this file:

<%
DIM addstuff

Set addstuff=Server.CreateObject("adodb.connection")
addstuff.ConnectionString="Provider=Microsoft.Jet. OLEDB.4.0;Data Source="&Server.MapPath("db/n395aeval.mdb") & "Persist Security Info=False"

addstuff.Open

varfinal_score=request.querystring("varfinal_score ")
employeeid=request.querystring("employeeid")
varelapsedtime=request.querystring("varelapsedtime ")
varcurrentdate=request.querystring("varcurrentdate ")
varcurrenttitlename=request.querystring("varcurren ttitlename")
varcurrenttitlename= Replace(varcurrenttitlename, "'", "~")
firstname=request.querystring("firstname")
firstname= Replace(firstname, "'", "~")
lastname=request.querystring("lastname")
lastname= Replace(lastname, "'", "~")

sqladd="INSERT INTO MAIN (varfinal_score,employeeid,varelapsedtime,varcurre ntdate,varcurrenttitlename,firstname,lastname) VALUES ('"&varfinal_score&"','"&employeeid&"','"&varelaps edtime&"','"&varcurrentdate&"','"&varcurrenttitlen ame&"','"&firstname&"','"&lastname&"')"

addstuff.execute(sqladd)
addstuff.Close
Set addstuff= Nothing
%>


Any suggestions would be most appreciated!

Thank you!

 
Old February 3rd, 2006, 07:48 PM
Authorized User
 
Join Date: Feb 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi dsargent


You Set AddStuff connection bat Where is Recrodset ?

Code:
Set Rs = addstuff.execute(sqladd) 

RS.close
Set RS = Nothing
addstuff.Close 
Set addstuff= Nothing
And Column "varcurrentdate" is text o Date/time ?
Because if Date/time #"& varcurrentdate &"#


Ciao :D
Steweb




I don’t Speak English very well, excuse me !

www.steweb.net





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble writing to an Access Database JAdkins Classic ASP Basics 5 June 27th, 2007 03:05 PM
writing to a ms access database angel79 Classic ASP Databases 2 May 25th, 2005 11:03 AM
Writing Variables in iFRAMES with Mouseover Brian_____ Javascript How-To 3 May 26th, 2004 11:04 PM
Writing to access database from asp.et RaZorCleaN Access 2 October 9th, 2003 01:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.