Professional Web Applications Themes

Another Dumbass Question: Table not found - ASP.NET General

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...

  1. #1

    Default 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

  2. #2

    Default 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" <bethNOT-SO-bad-dawgs-in-ak.com> wrote in message
    news:Xns93D08FF5265B2bethNOTSObaddawgsina216.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
    >

    John Timney \(Microsoft MVP\) Guest

  3. #3

    Default Re: Another Dumbass Question: Table not found

    "John Timney \(Microsoft MVP\)" <timneyjdespammed.com> wrote in
    news:OXXkHITXDHA.1644TK2MSFTNGP10.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

  4. #4

    Default 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" <bethNOT-SO-bad-dawgs-in-ak.com> wrote in message
    news:Xns93D097E1D6018bethNOTSObaddawgsina216.168. 3.44...
    > "John Timney \(Microsoft MVP\)" <timneyjdespammed.com> wrote in
    > news:OXXkHITXDHA.1644TK2MSFTNGP10.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

Similar Threads

  1. ODBC Error Code = S0002 (Base table not found)
    By Glen T in forum Coldfusion Database Access
    Replies: 4
    Last Post: September 20th, 01:10 AM
  2. Given fieldname could not be found in the table.
    By Pappy17 in forum Coldfusion Database Access
    Replies: 24
    Last Post: August 2nd, 02:51 AM
  3. No records found for MySQL Table
    By wittsdd in forum Coldfusion Database Access
    Replies: 4
    Last Post: April 9th, 12:54 AM
  4. Fix It, Dumbass?
    By Jinky_Williams@adobeforums.com in forum Adobe Indesign Windows
    Replies: 0
    Last Post: April 26th, 11:13 PM
  5. Replies: 1
    Last Post: July 16th, 03:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139