Forum Moderators: open
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 ---
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:
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.
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
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.
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