Connecting To MS Access database

jetster

New member
Joined
Jan 26, 2005
Messages
4
Programming Experience
Beginner
Just trying to display some Access Database data this code does not work:
VB.NET:
PrivateSub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
 
'Put user code to initialize the page here
 
Dim dsCategories AsNew DataSet()
 
Dim cmdCategories AsNew OleDbCommand()
 
Dim sSelect AsString
 
sSelect = "Select LongName From Customers"
 
cmdCategories.CommandText = sSelect
 
 
 
Dim conCategories AsNew OleDbConnection()
 
conCategories.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Password=;UserID=Admin;DataSource=C:\Documents and Settings\Johnny Jet\Desktop\dbWeen.mdb"
 
cmdCategories.Connection = conCategories
 
 
 
 
 
Dim daCategories AsNew OleDbDataAdapter()
 
daCategories.SelectCommand = cmdCategories
 
daCategories.Fill(dsCategories, "Categories")
 
 
 
EndSub



I get this error:


Server Error in '/AccessCoded' Application.

Could not find installable ISAM.

[FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Could not find installable ISAM.

Source Error:

Line 40: daCategories.SelectCommand = cmdCategoriesLine 41: Line 42: daCategories.Fill(dsCategories, "Categories")Line 43: Line 44:
Source File: c:\inetpub\wwwroot\AccessCoded\WebForm1.aspx.vb Line: 42

Stack Trace:

[OleDbException (0x80004005): Could not find installable ISAM.] System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) System.Data.OleDb.OleDbConnection.InitializeProvider() System.Data.OleDb.OleDbConnection.Open() System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) AccessCoded.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\AccessCoded\WebForm1.aspx.vb:42 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()

Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0 [/FONT]


Help!! I even copied what visual studio connection wizard came up with for
a connection string which was about 100 words long and that didn't help.
 
Last edited by a moderator:
have u tried using another database such as sql server or msde. access might not be the exact thing to use in a network environment...
 
Back
Top