Ask a Question related to ASP.NET General, Design and Development.
-
Child #1
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
Child Guest
-
ODBC Error Code = S0002 (Base table not found)
I just deployed my first CF application. The ISP has set up the DSN. But now, when I run the application, I get the following error: ODBC Error... -
Given fieldname could not be found in the table.
Another newbie question here. I am trying to update one table ("Table A") and insert into another table ("Table B"): <cfquery DATASOURCE="tech... -
No records found for MySQL Table
Hello, We have a MySQL table that we had been using PHP to query, but now we want to query the table using CF 5.0 on a windows 2000 server. The... -
Fix It, Dumbass?
Bwahahaha! Got my laugh for the day. Everyone's replies as well as the original post. Great fun to be had. -
Help with inserting values from information not found in another table
I have a tmp_phone that I am comparing to table_phonelistings using the phone field. I then want to insert the values (ac,phone) from the... -
John Timney \(Microsoft MVP\) #2
Re: Another Dumbass Question: Table not found
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" <beth@NOT-SO-bad-dawgs-in-ak.com> wrote in message
news:Xns93D08FF5265B2bethNOTSObaddawgsina@216.168. 3.44...not my> Sadly, I am learning this using Access, no cracks please, its certainlythat the table> preference:
>
> I am attempting to connect to the database using OLEDB, but it returnsother tables yeild> cannot be found. The table is there and the name is correct. Severalstuff can't> the same results. Is there some bizarre permissions issue whereby the OLE> 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
>
John Timney \(Microsoft MVP\) Guest
-
Child #3
Re: Another Dumbass Question: Table not found
"John Timney \(Microsoft MVP\)" <timneyj@despammed.com> wrote in
news:OXXkHITXDHA.1644@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.
Child Guest
-
John Timney \(Microsoft MVP\) #4
Re: Another Dumbass Question: Table not found
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" <beth@NOT-SO-bad-dawgs-in-ak.com> wrote in message
news:Xns93D097E1D6018bethNOTSObaddawgsina@216.168. 3.44...> "John Timney \(Microsoft MVP\)" <timneyj@despammed.com> wrote in
> news:OXXkHITXDHA.1644@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.
John Timney \(Microsoft MVP\) Guest



Reply With Quote

