Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 April 17th, 2006, 11:06 PM
Authorized User
 
Join Date: Oct 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Missing parameter in Jet OLEDB connection

Hello,

I am trying to connect to an Access database and get error "No value given for one or more required parameters.".

My code comes from two sources, a book and MSDN.

void ReadDatabase() {
    OleDbConnection objConn = new OleDbConnection(
                                 "Provider=Microsoft.Jet.OLEDB.4.0;" +
                                 "Data Source=d:\\inetpub\\wwwroot\\myweb\\database\\myda tabase.mdb" );
    String query = "SELECT GuestBook.ID, GuestBook.Date, GuestBook.Name, GuestBook.Comments FROM GuestBook";
    OleDbCommand objCmd = new OleDbCommand( query , objConn );
    objConn.Open();
    OleDbDataReader drBooks = objCmd.ExecuteReader(); // offending line
    while (drBooks.Read())
    {
        Response.Write("<li>");
        Response.Write(drBooks["Date"]);
        Response.Write("\t");
        Response.Write(drBooks["Name"]);
        Response.Write("</li>");
    }
objConn.Close();
}

 
Old April 19th, 2006, 11:51 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Have you tried a different operation with the connection to ascertain whether the offending item is the the connection or the command object?
 
Old April 21st, 2006, 11:29 PM
Authorized User
 
Join Date: Oct 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Brian,

I did not try a new opporation because I don't what would be a good test. I did try a couple of things with the connection:

Map Path which netted:
D:\Inetpub\wwwroot\MyWeb\ydatabase.mdb and got
Could not find file 'd:\Inetpub\wwwroot\Myweb\ydatabase.mdb' and

D:\Inetpub\wwwroot\MyWeb\database\\ydatabase.mdb and got
Could not find file 'd:\inetpub\wwwroot\myweb\database\ydatabase.mdb'

Then I set the web.config appSettings to

And then appSettings to
D:\Inetpub\wwwroot\MyWeb\database\mydatabase.mdb and got
No value given for one or more required parameters. on the open statement.

Not sure what else to do.

Thanks for your help






Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft.Jet.OLEDB.4.0 not registerd on local m/c raychoudhury BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 0 January 2nd, 2008 02:23 PM
Using Jet OLEDB sureshkumarct Visual C++ 0 May 30th, 2006 02:00 AM
OLEDB Connection Dialog Kep C# 4 December 15th, 2004 06:10 PM
Need HELP, MS access DB, Jet OLEDB, asp Caley L. Baumgart Classic ASP Databases 7 March 23rd, 2004 11:53 AM
Trying to find the Microsoft JET OLEDB download marthaj Access ASP 3 September 23rd, 2003 11:53 PM





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