473,398 Members | 2,125 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,398 software developers and data experts.

Simple Access DB connection Not working

Joe
I am trying to create a simple connection to a Access DB
and receive the following OleDbException error

System.Data.OleDb.OleDbException: Unspecified error at
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32
hr) at
System.Data.OleDb.OleDbConnection.InitializeProvid er() at
System.Data.OleDb.OleDbConnection.Open() at
RepNetWeb.Events.BindData() in
C:\projects\kuhns\repIntranet\repNetWeb\Pages\Even ts\Event
s.aspx.vb:line 47

I am using the following code in
Sub BindData()
Dim ConnectionString As String
= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("..\..\Files\dB\KBWEB.MDB")

Dim QuerySQL As String = "SELECT * FROM KBEVENTS"

Dim objConn As New OleDbConnection
(ConnectionString)
Dim objCmd As New OleDbCommand(QuerySQL, objConn)

Try
objConn.Open()
dgEvents.DataSource = objCmd.ExecuteReader()
dgEvents.DataBind()

Catch ex As OleDbException
lblError1.Text = ConnectionString
lblError2.Text = ex.ToString
Finally
objConn.Close()
End Try

End Sub

The code runs fine on some machines but recieved the
above mentioned errors on others. I have checked the
permisions on the file and the folder and everything is
identical. Any help is greattly appreciated.

Thanks,
Jul 21 '05 #1
1 2350
Don't use a datareader as a datasource to databind to... ever..

"Joe" <jj*@itgsytems.com> wrote in message
news:27****************************@phx.gbl...
I am trying to create a simple connection to a Access DB
and receive the following OleDbException error

System.Data.OleDb.OleDbException: Unspecified error at
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32
hr) at
System.Data.OleDb.OleDbConnection.InitializeProvid er() at
System.Data.OleDb.OleDbConnection.Open() at
RepNetWeb.Events.BindData() in
C:\projects\kuhns\repIntranet\repNetWeb\Pages\Even ts\Event
s.aspx.vb:line 47

I am using the following code in
Sub BindData()
Dim ConnectionString As String
= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("..\..\Files\dB\KBWEB.MDB")

Dim QuerySQL As String = "SELECT * FROM KBEVENTS"

Dim objConn As New OleDbConnection
(ConnectionString)
Dim objCmd As New OleDbCommand(QuerySQL, objConn)

Try
objConn.Open()
dgEvents.DataSource = objCmd.ExecuteReader()
dgEvents.DataBind()

Catch ex As OleDbException
lblError1.Text = ConnectionString
lblError2.Text = ex.ToString
Finally
objConn.Close()
End Try

End Sub

The code runs fine on some machines but recieved the
above mentioned errors on others. I have checked the
permisions on the file and the folder and everything is
identical. Any help is greattly appreciated.

Thanks,

Jul 21 '05 #2

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

Similar topics

5
by: calaha | last post by:
Hi all, I have been working with this since last night, and can't quite figure out why it's not working. I have a simple login box form that is set to be my startup form in my Access app (upon...
6
by: Terry Bell | last post by:
We've had a very large A97 app running fine for the last seven years. I've just converted to SQL Server backend, which is being tested, but meanwhile the JET based version, running under terminal...
7
by: Larry B via DotNetMonster.com | last post by:
Hello, I seem to be having a problem with inserting data, from a web form, into an access database. I have tried to do the same thing in a regular windows app, there it works fine, but when I...
1
by: Joe | last post by:
I am trying to create a simple connection to a Access DB and receive the following OleDbException error System.Data.OleDb.OleDbException: Unspecified error at...
1
by: somersbar | last post by:
hey, ive been trying to set up a web form in visual basic.net that can access a microsoft access database. i need to use odbc also. i can get it working using a windows form but not a web form....
5
by: samadams_2006 | last post by:
I'm having a problem in accessing a Microsoft Access Database in a VB.NET Web Application. It's so straight forward, I thought I'd walk you through all the details here: 1) I have a .NET Web...
2
by: samadams_2006 | last post by:
I'm trying to get a simple VB.NET "Web Application" (not a regular application) to work with an Access Database. Seems simple enough, but I cannot seem to get it working. If anyone has a simple...
3
by: Blarneystone | last post by:
Ok, I've got a simple access 97 db. named S_tracking.mdb It has two tables 1- Jobs 2- Employees I've set up the references: Imports System.Data.OleDb Imports System.IO Imports System.data
1
by: brendanmcdonagh | last post by:
The following code makes a connection to my server as i see it in the access file. String url =...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.