473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Runtime error when trying to connect to an Access DB

Jim
Hello everyone,

This is my first time posting to a Usenet group, so please excuse any
Netiquette errors I may have in my post. I have used ASP.NET before
using C#, but never VB, so I'm trying to practice using VB. I have a
very simple page that I would like to connect to an Access DB and
output some fields. Here's the code that I have:

<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<%
Dim strconn As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=" + Server.MapPath("~/test.mdb") & ";"
Dim sql As String = "SELECT * FROM Employees"
Dim connection As New OleDbConnection(strconn)
Dim ds As DataSet = New DataSet()
Dim da As New OleDbDataAdapter(sql, connection)
da.Fill(ds, "T1")
DataGrid1.DataSource = ds
DataGrid1.DataBind()
%>

<html>

<head>
<title>test</title>
</head>

<body>

<%
Dim dc As DataColumn
Dim dr As DataRow
For Each dr In ds.Tables(0).Rows
For Each dc In ds.Tables(0).Columns
Response.Write(dr(dc.ColumnName).ToString())
Next
Next
%>

</body>
</html>
When I go to this page in my web browser, I get 'Server Error in '/
DotNet' Application, followed by 'Runtime Error'. The Description
says 'An application error occurred on the server.' There is more to
the error, but I'm assuming this is a generic error that you guys (and
gals) have seen before. Any suggestions?

Jan 30 '07 #1
2 1492
Make sure you set permissions on the file AND the folder.

the folder: because it needs to create an .ldb file.

...

Other than that, you need to specify an exact message.

Turn off "friendly http errors" on your IE options. (something like that)

Remember "who are you" in a web environment. asp.net doesnt run under
IUSR_, it runs under ASPNET

"Jim" <Ja**********@gmail.comwrote in message
news:11*********************@v45g2000cwv.googlegro ups.com...
Hello everyone,

This is my first time posting to a Usenet group, so please excuse any
Netiquette errors I may have in my post. I have used ASP.NET before
using C#, but never VB, so I'm trying to practice using VB. I have a
very simple page that I would like to connect to an Access DB and
output some fields. Here's the code that I have:

<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<%
Dim strconn As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=" + Server.MapPath("~/test.mdb") & ";"
Dim sql As String = "SELECT * FROM Employees"
Dim connection As New OleDbConnection(strconn)
Dim ds As DataSet = New DataSet()
Dim da As New OleDbDataAdapter(sql, connection)
da.Fill(ds, "T1")
DataGrid1.DataSource = ds
DataGrid1.DataBind()
%>

<html>

<head>
<title>test</title>
</head>

<body>

<%
Dim dc As DataColumn
Dim dr As DataRow
For Each dr In ds.Tables(0).Rows
For Each dc In ds.Tables(0).Columns
Response.Write(dr(dc.ColumnName).ToString())
Next
Next
%>

</body>
</html>
When I go to this page in my web browser, I get 'Server Error in '/
DotNet' Application, followed by 'Runtime Error'. The Description
says 'An application error occurred on the server.' There is more to
the error, but I'm assuming this is a generic error that you guys (and
gals) have seen before. Any suggestions?

Jan 30 '07 #2
Jim
Thanks for the reply. I have a feeling that it has something to do
with the folder permissions. I do have write access to this
directory, but maybe connecting to a DB is under a different setting?
I'm not really savvy with server permissions, but I'll check into it.
Thanks again.

Oh, I'm doing this at work, so that's why I need to check into it. I
just realized that I probably sounded a little strange saying I needed
to check into it if it was on my own computer.
On Jan 30, 4:21 pm, "sloan" <s...@ipass.netwrote:
Make sure you set permissions on the file AND the folder.

the folder: because it needs to create an .ldb file.

..

Other than that, you need to specify an exact message.

Turn off "friendly http errors" on your IE options. (something like that)

Remember "who are you" in a web environment. asp.net doesnt run under
IUSR_, it runs under ASPNET

"Jim" <James.T.H...@gmail.comwrote in message

news:11*********************@v45g2000cwv.googlegro ups.com...
Hello everyone,
This is my first time posting to a Usenet group, so please excuse any
Netiquette errors I may have in my post. I have used ASP.NET before
using C#, but never VB, so I'm trying to practice using VB. I have a
very simple page that I would like to connect to an Access DB and
output some fields. Here's the code that I have:
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%
Dim strconn As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=" + Server.MapPath("~/test.mdb") & ";"
Dim sql As String = "SELECT * FROM Employees"
Dim connection As New OleDbConnection(strconn)
Dim ds As DataSet = New DataSet()
Dim da As New OleDbDataAdapter(sql, connection)
da.Fill(ds, "T1")
DataGrid1.DataSource = ds
DataGrid1.DataBind()
%>
<html>
<head>
<title>test</title>
</head>
<body>
<%
Dim dc As DataColumn
Dim dr As DataRow
For Each dr In ds.Tables(0).Rows
For Each dc In ds.Tables(0).Columns
Response.Write(dr(dc.ColumnName).ToString())
Next
Next
%>
</body>
</html>
When I go to this page in my web browser, I get 'Server Error in '/
DotNet' Application, followed by 'Runtime Error'. The Description
says 'An application error occurred on the server.' There is more to
the error, but I'm assuming this is a generic error that you guys (and
gals) have seen before. Any suggestions?- Hide quoted text -

- Show quoted text -

Jan 31 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: James Kupernik | last post by:
Hello everyone! I'm hoping someone can shed some light on my ever daunting mysql/php problem. I'm currently trying to get a new server up and running using apache/php/mysql. Everything runs...
9
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm...
2
by: Paul | last post by:
I'm hoping someone can help me with the problem. I have a database where the default value for a date field in a table is =date() This works perfectly in my table and on my form. But when I...
0
by: Barb | last post by:
Hello again, I had posted over the past couple of days regarding a connection issue I was having to my production database from an Access project. I sorted that out by using integrated Windows...
2
by: arsisthesis | last post by:
Hi all, I have a curious problem with the ERROR 1044 and 1045: -system: OS X 10.4.3 (bash shell) -bash schell prompt: /~ kssun$ -I have set passwd to 'kssun' -I set path:...
4
by: john d | last post by:
I have an IIS 5.0 server with a Virtual Directory called test. This virtual directory points to a share on the network, \\server1\share\ and uses a valid domain account in the "Connect As" field....
1
by: TeeCo | last post by:
Hi folks. I'm trying to change the location of the Access mdb file I connect to using OleDb and am having trouble. I'm using Visual C# 2005 and the default values I use for the ConnectionString...
7
by: mike | last post by:
We have numerous Access 97 apps that we run on our Terminal Server, but two apps in particular is giving us a problem. The problem we are running into is when you select a drop down menu, it errors...
1
by: rickcross | last post by:
I am trying to use the Access 2007 runtime. I have a program that is fully working in 2007 but when I install the runtime version with same Operating system and Access 2003 installed I have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.