Forum Moderators: open

Message Too Old, No Replies

Could not find installable ISAM

Microsoft's article doesn't help

         

chris_f

1:08 pm on Jun 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've got a problem (ok I've got loads, but this is a particular one).

I am having to change my site from DSN-less to a DSN connection. However, I am now getting the error message Could not find installable ISAM. I have read the Microsoft article here [support.microsoft.com] but I don't know which file is causing the problem.

I am simply trying to connect to an Access 2000 database. No commands. Just connect then disconnect.

I've included my code below. Can some please help me. It has been bugging me for ages and I can't get a direct response from any site. If I use the same code but alter it to be DSN-Less it works.

Thanks in advanced.
Chris.

--- START CONNECT_DSN.aspx ---

<%@ Page Language="vb" Debug="true" AutoEventWireup="false" Codebehind="connect_DSN.aspx.vb" Inherits="Test.connect_DSN"%>
<html>
<head>
<title>MS Access Database Example</title>
</head>
<body>
<asp:label id="connection_open" runat="server" /><br>
<asp:label id="connection_close" runat="server" />
</body>
</html>

--- END CONNECT_DSN.aspx ---

--- START CONNECT_DSN.aspx.vd ---

Imports System.Data
Imports System.Data.OleDb

Public Class connect_DSN
Inherits System.Web.UI.Page

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

Dim conn As OleDbConnection
conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DSN=TestProject")

Dim connection_open As Label
Dim connection_close As Label

conn.Open()
connection_open.Text = "Connection open!"
conn.Close()
connection_close.Text = "Connection closed!"

End Sub

End Class

--- END CONNECT_DSN.aspx.vb ---

Xoc

3:48 pm on Jun 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your connection string is messed. Try something like this:

Provider=MSDASQL.1;Persist Security Info=False;User ID=Admin;Data Source=TestProject;Initial Catalog=C:\foo\bar\testproject.mdb

The general way to create a connection string, is to:


  1. Create a blank file with the file extension .udl
  2. Right click on it in the windows explorer and select properties
  3. Go to the provider tab and select Microsoft OLE DB Provider for ODBC Databases
  4. Press the Next>> button
  5. Fill in the rest of the info on the Connection Tab
  6. Press OK and close the dialog
  7. Open the udl file in notepad
  8. The connection string you need will be in plain text

BTW, do you really need a DSN? There are other ways that are easier and more efficient.

txbakers

4:09 pm on Jun 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm having the same problem with an ODBC connection. The documentation says to download the ODBC.NET files, which I did, but it still doesn't accept a DSN as part of the string.

I'd rather use the DSN for connecting to other types of databases, most notably AS/400.

chris_f

4:15 pm on Jun 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Xoc,

Thanks for your help. I'll give it a go and report back.

I prefer to use a DSN-Less connection. However, as a company will be hosting my site, I do not know whether my files will be stored in their directory structure. Also, they prefer to use DSN and as such give away free DSN connections. Hope this is clear.

Chris.

chris_f

4:19 pm on Jun 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



3. Go to the provider tab and select Microsoft OLE DB Provider for ODBC Databases

I can't see this. Do you mean Microsoft OLE DB Provider for ODBC Drivers?

Chris

chris_f

4:30 pm on Jun 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The line
conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DSN=TestProject")
now reads
conn = New OleDbConnection("Provider=MSDASQL.1;Password=test;Persist Security Info=True;User ID=Admin;Data Source=TestProject2;Initial Catalog=C:\sites\Test\testdb2")
however, it still does not work. I now get the following error message:

The .Net Data OLE DB Provider(System.Data.OleDb) does not support the MSDASQL Provider, Microsoft OLE DB Provider for ODBC Drivers.

Can anyone help. It could be related to post #5.

Chris

Xoc

4:50 pm on Jun 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry, typo on my part. You got the right one. Nuts. That should work for standard ADO, but apparently ADO.NET wants a different connection string. Okay, try this:

Provider=MSDASQL.1;Persist Security Info=False;User ID=Admin;Data Source=TestProject;Extended Properties="DSN=TestProject;DBQ=C:\foo\bar\TestProject;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;";Initial Catalog=C:\foo\bar\TestProject

I got this by going to Visual Studio .NET and using the server explorer window. I added a new connection and went to the properties to see the string.

chris_f

2:56 pm on Jun 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Xoc,

I probably won't be able to get to my computer for the next couple of days (I started a new job today), however, I'll will give it a go as soon as I can. I'll let you know how it goes then.

Thanks again for your help. It is grealy appreceiated.

Chris.

chris_f

4:53 pm on Jun 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Xoc,

I've given you change a try but I'm getting the following error message. (I could nearly kiss you however, I'm male ;)).

Chris.

In the code below I put the space in the 3 w's root folder to stop the message board changing them into links and including http

--- ERROR---

The .Net Data OLE DB Provider(System.Data.OleDb) does not support the MSDASQL Provider, Microsoft OLE DB Provider for ODBC Drivers.
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.ArgumentException: The .Net Data OLE DB Provider(System.Data.OleDb) does not support the MSDASQL Provider, Microsoft OLE DB Provider for ODBC Drivers.

Source Error:

Line 27: Dim conn As OleDbConnection
Line 28: 'conn = New OleDbConnection("Provider=MSDASQL.1;Password=test;Persist Security Info=True;User ID=Admin;Data Source=TestProject2;Initial Catalog=C:\Inetpub\ww wroot\sites\Test\testdb2")
Line 29: conn = New OleDbConnection("Provider=MSDASQL.1;Persist Security Info=False;User ID=Admin;Data Source=TestProject;Extended Properties=DSN=TestProject2;DBQ=C:\Inetpub\ww wroot\sites\Test;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;Initial Catalog=C:\Inetpub\ww wroot\sites\Test\")
Line 30:
Line 31: Dim connection_open As Label

Source File: C:\Inetpub\ww wroot\sites\Test\connect_DSN.aspx.vb Line: 29

Xoc

9:48 pm on Jun 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds to me as if something is not installed or not installed correctly on the system. That should have worked. Do you have the latest Jet installed? Go to [windowsupdate.com...] and download and install the latest Jet. If you do have the latest one, reinstall it.

chris_f

7:58 am on Jun 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've been having alot of problems of late. I will reinstall .net over the weekend.

Will speak to you then. Thanks for the help.

Chris.