Is there anything like an 'exists table' method I can use?

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Is there anything like an 'exists table' method I can use?

    I need to run a querry from an asp page only if a certain
    table exists in the data base. Is there any kind of
    method that can look at the database (Access) and tell me
    whether or not a certain table exists before running the
    querry?

    Thanks
    Marshal Guest

  2. Similar Questions and Discussions

    1. Table exists?
      Hi, can anyone tell me, how to find out if a table in an MS Access DB exists? Also, I'd like to find out, if certain columns exits if a table...
    2. Check if table exists
      ON.KG wrote: One thing to consider: you are making a trip to the database to determine if a table exists. If it exists, you are then making...
    3. method name exists, property value exists, calling method fails
      I have a class object I am calling in another class: class Stuff { var $myObj; function Stuff($myObj) { $this->myObj = $myObj; }
    4. Testing if a mysql table exists
      Is there a simple way to test if a mysql table exists? JUST One line !
    5. Table Exists
      I am wanting to check the existance of a table in my informix db before I query it, since if I query a table that does not exist, it'll blow up on...
  3. #2

    Default Re: Is there anything like an 'exists table' method I can use?

    You could execute a query like so:

    sSQL = "SELECT COUNT([name]) FROM [MSysObjects] WHERE [Name]='"
    YourTableName & "' AND [Type]=1"
    bTableExists = oYourADOConnection.Execute(sSQL).Fields.Item(0).Va lue > 0

    This is untested.

    Ray at work

    "Marshal" <marshalwdr@hotmail.com> wrote in message
    news:1ba0201c38829$5edb8fb0$a601280a@phx.gbl...
    > I need to run a querry from an asp page only if a certain
    > table exists in the data base. Is there any kind of
    > method that can look at the database (Access) and tell me
    > whether or not a certain table exists before running the
    > querry?
    >
    > Thanks

    Ray at Guest

  4. #3

    Default Re: Is there anything like an 'exists table' method I can use?

    Another alternative is to use ADOX: [url]http://www.aspfaq.com/2350[/url]




    "Marshal" <marshalwdr@hotmail.com> wrote in message
    news:1ba0201c38829$5edb8fb0$a601280a@phx.gbl...
    > I need to run a querry from an asp page only if a certain
    > table exists in the data base. Is there any kind of
    > method that can look at the database (Access) and tell me
    > whether or not a certain table exists before running the
    > querry?
    >
    > Thanks

    Aaron Bertrand - MVP Guest

  5. #4

    Default Re: Is there anything like an 'exists table' method I can use?

    Thanks Ray...works like a charm. :)

    Marshal
    >-----Original Message-----
    >You could execute a query like so:
    >
    >sSQL = "SELECT COUNT([name]) FROM [MSysObjects] WHERE
    [Name]='"
    >YourTableName & "' AND [Type]=1"
    >bTableExists = oYourADOConnection.Execute
    (sSQL).Fields.Item(0).Value > 0
    >
    >This is untested.
    >
    >Ray at work
    >
    >"Marshal" <marshalwdr@hotmail.com> wrote in message
    >news:1ba0201c38829$5edb8fb0$a601280a@phx.gbl...
    >> I need to run a querry from an asp page only if a
    certain
    >> table exists in the data base. Is there any kind of
    >> method that can look at the database (Access) and tell
    me
    >> whether or not a certain table exists before running
    the
    >> querry?
    >>
    >> Thanks
    >
    >
    >.
    >
    Marshal Guest

  6. #5

    Default Re: Is there anything like an 'exists table' method I can use?

    Thanks for the help...much appreciated. :)

    >-----Original Message-----
    >Another alternative is to use ADOX:
    [url]http://www.aspfaq.com/2350[/url]
    >
    >
    >
    >
    >"Marshal" <marshalwdr@hotmail.com> wrote in message
    >news:1ba0201c38829$5edb8fb0$a601280a@phx.gbl...
    >> I need to run a querry from an asp page only if a
    certain
    >> table exists in the data base. Is there any kind of
    >> method that can look at the database (Access) and tell
    me
    >> whether or not a certain table exists before running
    the
    >> querry?
    >>
    >> Thanks
    >
    >
    >.
    >
    Marshal Guest

Posting Permissions

  • You may not post new threads
  • You may 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