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 October 8th, 2003, 09:39 PM
Registered User
Join Date: Oct 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting forms fields into Access


I'm new to ASP and hope someone can help me.

I have a web form that I want the fields to be entered into an Access database.

When I hit the submit key, I get this error message:

Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/test/test.asp, line 22

It's a really simple page, and I'm sure it's a simple error, but I can't get the user input into the database. When I hard code a ein and name into the database it works fine.

Thanks for any help!



    Response.Expires = 0

    Dim objConn, objRS, strQ, strConn, strOutput
    Dim strConnection, strEin, strName

    strEin = Request.Form("ein")
    strName = Request.Form("name")

    Response.Write strEin & "<br/>"
    Response.Write strName

    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open strConnect

    strQ = "INSERT INTO Shippers (ein, name) VALUES "
    strQ = strQ & "(strEin, strName)"



Old October 9th, 2003, 03:24 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts

Hi there, tsparker...

you haven't used your variables, so this might help...
strQ = "INSERT INTO Shippers (ein, name) VALUES "
strQ = strQ & "(" & strEin & "," & strName & ")"
... however I see another thing, namely that the line...
objConn.Open strConnect
uses the variable strConnect, which is not declared or initialized anywhere (though perhaps in dataStores.asp).

Remember to close the connection.

Hope this helps


Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting fields in a related database abhi_loveu2002 ASP.NET 1.0 and 1.1 Basics 3 December 4th, 2006 09:02 AM
Inserting dates in forms zulf Dreamweaver (all versions) 2 November 22nd, 2004 02:20 PM
Memo Fields with Windows Forms in C# jim.stanley Access 0 November 15th, 2004 05:55 PM
Keep from inserting duplicates based on 2 fields tcarnahan SQL Server 2000 3 October 1st, 2004 07:19 AM
Inserting data from forms sarah82 Access 3 July 12th, 2004 08:45 AM

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