473,395 Members | 1,641 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,395 software developers and data experts.

Another Dumbass Question: Table not found

Sadly, I am learning this using Access, no cracks please, its certainly not my
preference:

I am attempting to connect to the database using OLEDB, but it returns that the table
cannot be found. The table is there and the name is correct. Several other tables yeild
the same results. Is there some bizarre permissions issue whereby the OLE stuff can't
see the tables unless I do something?

DBConn= New OLEDBConnection( _
"PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE= e:webdatabase
\apca_contact_data.mdb;")

DBCommand = New OleDBDataAdapter _
("Select Username, UserID from tblAPCAUsers order by username", DBConn)

Thanks in advance.
--
BethF, Anchorage, AK

Nov 17 '05 #1
3 940
The code example below is a VB.NET example of connecting to Access, give it
a try and see if you get the same results as the code looks very similar to
what you are trying to accomplish. It may be that your directory does not
have write permissions and cant actually open the DB, however as you dont
suggest its failing anywhere, only not finding a table that does exist then
that might have nothing to do with it.

On first sight, your code looks OK but do a comparison with the code I have
added below and see if you can spot a problem.

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

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

<script language="VB" runat="server">
Sub Page_Load(Src as object, E as EventArgs)

Dim objConnection As OleDbConnection
Dim objCommand As OleDbCommand
Dim objDataReader As OleDbDataReader
Dim strSQLQuery As String
objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=" & Server.MapPath("database.mdb") & ";")

strSQLQuery = "SELECT * FROM sample "

objCommand = New OleDbCommand(strSQLQuery, objConnection)

objConnection.Open()

objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConn ection)

resultsGrid.DataSource = objDataReader
resultsGrid.DataBind()

End Sub

</script>

<html>
<body>

<asp:DataGrid id="resultsGrid" runat="server"
cellspacing="1"
cellpadding="2"
HeaderStyle-Font-Bold="True"
ToolTip="This is Cool!"
MaintainViewState="false"
/>

</body>
</html>
"Child" <be**@NOT-SO-bad-dawgs-in-ak.com> wrote in message
news:Xn**********************************@216.168. 3.44...
Sadly, I am learning this using Access, no cracks please, its certainly not my preference:

I am attempting to connect to the database using OLEDB, but it returns that the table cannot be found. The table is there and the name is correct. Several other tables yeild the same results. Is there some bizarre permissions issue whereby the OLE stuff can't see the tables unless I do something?

DBConn= New OLEDBConnection( _
"PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE= e:webdatabase
\apca_contact_data.mdb;")

DBCommand = New OleDBDataAdapter _
("Select Username, UserID from tblAPCAUsers order by username", DBConn)

Thanks in advance.
--
BethF, Anchorage, AK

Nov 17 '05 #2
"John Timney \(Microsoft MVP\)" <ti*****@despammed.com> wrote in
news:OX**************@TK2MSFTNGP10.phx.gbl:

John, thanks much. I am a moron (i.e i got it)

I have cut and pasted your code, cause its prettier than mine. <vbg>
--
BethF, Anchorage, AK

It's YOUR God.
They are YOUR rules.
YOU burn in hell.
Nov 17 '05 #3
Glad to have helped :0)

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"Child" <be**@NOT-SO-bad-dawgs-in-ak.com> wrote in message
news:Xn**********************************@216.168. 3.44...
"John Timney \(Microsoft MVP\)" <ti*****@despammed.com> wrote in
news:OX**************@TK2MSFTNGP10.phx.gbl:

John, thanks much. I am a moron (i.e i got it)

I have cut and pasted your code, cause its prettier than mine. <vbg>
--
BethF, Anchorage, AK

It's YOUR God.
They are YOUR rules.
YOU burn in hell.

Nov 17 '05 #4

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

Similar topics

3
by: Jay | last post by:
Can you tell me why this isn't working? It's generated by easyphp 1.6 - myphpadmin. it's driving me bonkers!I go to create a table and this is the error I get...Thx in advance!CREATE TABLE...
0
by: claudel | last post by:
Hi I have a newb PHP/Javascript question regarding checkbox processing I'm not sure which area it falls into so I crossposted to comp.lang.php and comp.lang.javascript. I'm trying to...
6
by: Ken Post | last post by:
Hi All: I've read a whole slew of posts about creating temp tables using stored proceedures to get the crosstab ability, but I'm wondering if, for this specific case, there might be a more...
2
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
6
by: Sven Pran | last post by:
Probably the answer is there just in front of me only awaiting me to discover it, but: 1: I want to build a query that returns all records in one table for which there is no successful "join"...
4
by: Smartin | last post by:
Good Day All, I am using Oracle 7.3. Using the following table definition and sample data, how can I obtain the PayID which has the maximum PayDate for each AccountID? table Payments...
9
by: Joshua.Buss | last post by:
I am trying to move a record from one linked table to another within access, but I'm a complete beginner to VBA and don't know exactly where to begin. I have an access file that has the two...
6
by: Ted | last post by:
I am construvcting a number of databases, some of which contain sensitive data and most of which do not. I am attempting to handle the security issues involved in protecting sensitive data in part...
3
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.