Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Re: Checking whether a table exists in a database


Message #1 by jonathan@j... on Thu, 24 Oct 2002 14:43:05
Sorry to dig this one out of the archives but I'm trying to run the below 
code from within my ASP page and I get the following error:

"Microsoft JET Database Engine error '80040e09' 
Record(s) cannot be read; no read permission on 'MSysObjects'."


The code runs fine within Access as a Stored Query, but I can't make any 
changes or additions to the DB objects, so all SQL has to be within ASP.


Any ideas?
Jonathan



> Does the following work for an Access Database?
> Thanks,
> Ihsan. 
>  
>  Query msysobjects table.
>  
>  SELECT Name
>  FROM MSysObjects
>  WHERE Type = 1
>  AND Name = 'NameOfTable'
>  
>  If objRS is EOF then the table does not exist. Otherwise, it does
>  
>  Cheers
>  Ken
Message #2 by "Ken Schaefer" <ken@a...> on Fri, 25 Oct 2002 11:31:31 +1000
Are you logging in as "Admin" to the database?

That said, there are better ways to do this now. You can use the ADO Schema,
or ADOX instead...

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <jonathan@j...>
Subject: [asp_web_howto] Re: Checking whether a table exists in a database


: Sorry to dig this one out of the archives but I'm trying to run the below
: code from within my ASP page and I get the following error:
:
: "Microsoft JET Database Engine error '80040e09'
: Record(s) cannot be read; no read permission on 'MSysObjects'."
:
:
: The code runs fine within Access as a Stored Query, but I can't make any
: changes or additions to the DB objects, so all SQL has to be within ASP.
:
:
: Any ideas?
: Jonathan
:
:
:
: > Does the following work for an Access Database?
: > Thanks,
: > Ihsan.
: >
: >  Query msysobjects table.
: >
: >  SELECT Name
: >  FROM MSysObjects
: >  WHERE Type = 1
: >  AND Name = 'NameOfTable'
: >
: >  If objRS is EOF then the table does not exist. Otherwise, it does
: >
: >  Cheers
: >  Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index