Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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 December 13th, 2007, 12:33 PM
Authorized User
 
Join Date: Mar 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default response.write strSQL shows no values!

Hi,

I am trying to do simple insert into an access database.

I am receiving the error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.


When I response.write strSQL I receive the following:

INSERT INTO module1 (course,employee,comp,rma) VALUES (

Why are there no values?

When response.write the individual variables as you can see I have done in the code below, all appear fine above the insert into statement.

Full Code:

<%@ Language=VBScript %>
<%

course=request.form("course")
employee=request.form("employee")
comp=request.form("comp")
rma=request.form("rma")

response.write course & employee & comp & rma & "<br>"

Dim adoCon
Dim ObjRS
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database/license.mdb")
Set objRS = Server.CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO module1 (course,employee,comp,rma) VALUES ("' & course & "', '" & employee & "','" & comp & "', '" & rma & "');"
response.write strSQL
objRS.Open strSQL, adoCon

emp_no=request.form("employee")


response.redirect "http://intranet/health_safety/Store_H&S_Combined/LTT/rma_add.asp?emp_no=" & Request.form("employee")


%>

<html>

<head>
<title>New Page </title>
<meta name="Microsoft Border" content="tl, default">
</head>


<body>
</body>
</html>

Any ideas why this is not inserting into the database successfully?

Thanks in advance.




 
Old December 13th, 2007, 12:56 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Your first single quote in the values section is in the wrong place. Looks like a typo.


 
Old December 13th, 2007, 01:47 PM
Authorized User
 
Join Date: Mar 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by rstelma
 Your first single quote in the values section is in the wrong place. Looks like a typo.


I stared at that bloody thing for hours!

thanks for the reply mate.

 
Old December 13th, 2007, 01:50 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Yeah, I know. I'll be looking at somehting like you did for hours and my mate will take one quick look at it and see what I've been overlooking. Any time... glad its working for you.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Response.Write doesn't work? Ron Howerton Pro JSP 1 March 27th, 2007 02:03 AM
Response.Write won't work? Ron Howerton JSP Basics 1 March 23rd, 2007 07:39 AM
response.write crmpicco Classic ASP Basics 1 January 27th, 2005 06:31 PM
response.write netcrawler Classic ASP Databases 4 September 29th, 2004 10:13 AM
Response.write Sach Classic ASP Components 5 March 19th, 2004 06:40 AM





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