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 July 20th, 2003, 11:13 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kamran Send a message via Yahoo to kamran
Default help me in Database conactivity in ASP

Friends I'm make data data base with ASP. but still a problem the massage is comming that,


Microsoft OLE DB Provider for ODBC Driverserror '80004005'
[Microsoft][ODBC Microsoft Access Driver] Could not find file 'C:\student.mdb'.
/registered.asp, line 26


& the codeing is


<%

'Dimension variables
 Dim adoCon 'Holds the Database Connection Object
 Dim rsAddComments 'Holds the recordset for the new record to be added
 Dim strSQL 'Holds the SQL query to query the database

 Set adoCon = Server.CreateObject("ADODB.Connection")
 adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &Server.MapPath ("student")
 Set rsAddComments = Server.CreateObject("ADODB.Recordset")

 strSQL = "SELECT info.Fname, info.Lname, info.Country, info.City, info.Address, info.Contact, info.Email FROM student.mdb;"

 rsAddComments.CursorType = 2
 rsAddComments.LockType = 3
 rsAddComments.Open strSQL, adoCon
 rsAddComments.AddNew
 rsAddComments.Fields("FName") = Request.Form("Fname")
 rsAddComments.Fields("LName") = Request.Form("Lname")
 rsAddComments.Fields("Country") = Request.Form("Country")
 rsAddComments.Fields("City") = Request.Form("City")
 rsAddComments.Fields("Address") = Request.Form("Address")
 rsAddComments.Fields("Contact") = Request.Form("Contact")
 rsAddComments.Fields("Email") = Request.Form("Email")

 rsAddComments.Update
 rsAddComments.Close
 Set rsAddComments = Nothing
 Set adoCon = Nothing


%>

plz help me in this matter.



 
Old July 20th, 2003, 11:35 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

There are at least two problems in your code:

1. DBQ=" & Server.MapPath ("student")

You'll need to Map the path of the Entire database, so you'll need to change this to: DBQ=" & Server.MapPath ("student.mdb") where student.mdb is the name of your Access database

2. SELECT info.Fname, etc etc FROM student.mdb

You can't use the database name in a query; instead you need to reference a table:

2. SELECT info.Fname, etc etc FROM student

where student is a table in your student.mdb database.

Are the files for the website located in the root of your C drive?
HtH

Imar




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





Similar Threads
Thread Thread Starter Forum Replies Last Post
asp database alitoday Classic ASP Databases 1 November 16th, 2005 10:59 AM
Can Any One Suggest ME(ASP Database)? everest Classic ASP Databases 5 March 20th, 2004 05:24 AM
ASP to Access Database jwsoftware Classic ASP Databases 1 March 3rd, 2004 04:12 AM
MySql Database with ASP RobinR Classic ASP Databases 0 February 23rd, 2004 09:07 AM
ASP Database Project jasmine5544 Classic ASP Databases 1 November 13th, 2003 10:23 PM





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