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 March 19th, 2004, 03:52 PM
Authorized User
 
Join Date: Mar 2004
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can Any One Suggest ME(ASP Database)?

Hi all,
  I get the following error when i try to insert records into MS.Access Database

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Driver={Microsoft Ac'
/test/savenewuser.asp, line 24

my code is as follow
<%
    dim objConn, objrecordset, strSql
    dim uid, fname, lname, password, email

   uid = request.Form("txtuserid")
   fname = request.Form("txtfname")
   lname = request.Form("txtlname")
   password = request.Form("txtpassword")
   email = request.Form("txtemail")

    objConn = "Driver={Microsoft Access Driver (*.MDB)}; DBQ=C:/Inetpub/wwwroot/test/LogDatabase.mdb"
    set objrecordset = server.createobject("ADODB.recordset")
    strSql = "INSERT INTO tbllogin(userid, fname, lname, password, email) values('"& uid &"', '"& fname &"', '"& lname &"', '"& password &"', '"& email &"')"
      objrecordset.open strSql, objconn
    objConn.close
    set objrecordset = nothing

%>

Thanks in advance

 
Old March 19th, 2004, 04:43 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

    set objconn = Server.CreateObject("ADODB.Connection")
    objConn = "Driver={Microsoft Access Driver (*.MDB)}; DBQ=C:/Inetpub/wwwroot/test/LogDatabase.mdb"

Also, I always liked this instead of hard coding the path:

    objConn = "Driver={Microsoft Access Driver (*.MDB)};DBQ=" & _
Server.MapPath("LogDatabase.mdb")

 
Old March 19th, 2004, 04:48 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry... It should be:

    set objconn = Server.CreateObject("ADODB.Connection")
    objConn.Open "Driver={Microsoft Access Driver (*.MDB)}; DBQ=C:/Inetpub/wwwroot/test/LogDatabase.mdb"

OR:

    objConn = "Driver={Microsoft Access Driver (*.MDB)};DBQ=" & _
Server.MapPath("LogDatabase.mdb")


An aside: Where is the edit post button?

 
Old March 19th, 2004, 08:12 PM
Authorized User
 
Join Date: Mar 2004
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Default

U.N.C.L.E. Thank for the help.

can you tell me if i have to put that connection string in globale.asa, how do i do that?

thanks in advance



 
Old March 19th, 2004, 09:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You don't have to do that, you can define a global variable with it in it, or use an include file that defines it (latter is popular choice).
 
Old March 20th, 2004, 05:24 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:An aside: Where is the edit post button?
It's on the top of each message you posted. It's the third button (the middle one) and has a pencil on it.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 7- Suggest Stijn BOOK: Professional Ajax ISBN: 978-0-471-77778-6 2 July 21st, 2008 03:58 AM
suggest project, urgent.... jagan7 Java Basics 1 September 6th, 2007 11:09 AM
Suggest me Jagadeesh.brk J2EE 2 May 23rd, 2007 10:49 PM
novice to asp.net.... suggest how to start ganeshshmg ASP.NET 2.0 Basics 1 September 28th, 2006 08:11 AM
can u suggest me? ujjwal BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 November 18th, 2004 06:18 PM





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