Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 3rd, 2006, 01:56 PM
Registered User
 
Join Date: Feb 2006
Location: , , .
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!

Reply With Quote
  #2 (permalink)  
Old February 3rd, 2006, 07:48 PM
Authorized User
 
Join Date: Feb 2006
Location: Verona, Italy, Italy.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.