Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: contents of query to a drop down menu


Message #1 by "Eimear Flynn" <flynneimear@h...> on Wed, 13 Feb 2002 15:03:24
Hi, i recently created a query(qryTableNames) in access which holds the 

names of all the tables in that database, whether tables are added, 

deleted, etc...

I then created an ASP page with a drop down menu and i want to be able to 

allow the user to select a particular table. I want to know if i can 

populate the menu with the contents of the query, ie: the table names and 

allow the user to select that table name.

However, i keep getting errors and cannot figure out the problem. Here is 

the code ive been using:





<p align="center">Please select the name of the table you would like to 

        delete :</p>

      <form method="post" action="DelTable.asp">

        <div align="center"> 

          <p>Table 



<%

dim objRS

set objRS = server.createobject("ADODB.recordset")



objRS.open "QryTableNames", objConn, adOpenforwardonly, adlockreadonly, 

adCmdStoredProc

%>

            <select name="TableName">

<%              

'dim stateSQL

'stateSQL = "select * from QryTableNames"



do until objRS.eof

%>

<option> <%objRS("Name")%> </option>

<%

objRS.movenext

loop

%> 

            </select>

            <%

objRS.close

objConn.close

%> 



Can someone please help me.



Thanks,

Eimear Flynn
Message #2 by "Jeffrey Lee" <leech74@s...> on Thu, 14 Feb 2002 01:01:00 +0800
What is the error?

----- Original Message -----

From: "Eimear Flynn" <flynneimear@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, February 13, 2002 3:03 PM

Subject: [asp_databases] contents of query to a drop down menu





> Hi, i recently created a query(qryTableNames) in access which holds the

> names of all the tables in that database, whether tables are added,

> deleted, etc...

> I then created an ASP page with a drop down menu and i want to be able to

> allow the user to select a particular table. I want to know if i can

> populate the menu with the contents of the query, ie: the table names and

> allow the user to select that table name.

> However, i keep getting errors and cannot figure out the problem. Here is

> the code ive been using:

>

>

> <p align="center">Please select the name of the table you would like to

>         delete :</p>

>       <form method="post" action="DelTable.asp">

>         <div align="center">

>           <p>Table

>

> <%

> dim objRS

> set objRS = server.createobject("ADODB.recordset")

>

> objRS.open "QryTableNames", objConn, adOpenforwardonly, adlockreadonly,

> adCmdStoredProc

> %>

>             <select name="TableName">

> <%

> 'dim stateSQL

> 'stateSQL = "select * from QryTableNames"

>

> do until objRS.eof

> %>

> <option> <%objRS("Name")%> </option>

> <%

> objRS.movenext

> loop

> %>

>             </select>

>             <%

> objRS.close

> objConn.close

> %>

>

> Can someone please help me.

>

> Thanks,

> Eimear Flynn




$subst('Email.Unsub').



Message #3 by "Eimear Flynn" <flynneimear@h...> on Wed, 13 Feb 2002 22:59:39
> What is the error?



This is my error. Have a look and see what you think :







Please select the name of the table you would like to delete :



Table 



Microsoft OLE DB Provider for ODBC Drivers error '80040e09' 



[Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no 

read permission on 'MSysObjects'. 



/prjcsm3021/Project/DeleteTable.asp, line 146 







Line 146 of the asp page is : 



objRS.open "QryTableNames", objConn, adOpenforwardonly, adlockreadonly, 

adCmdStoredProc



Message #4 by "Jeffrey Lee" <leech74@s...> on Thu, 14 Feb 2002 07:16:14 +0800
Seems to be that the "QryTableNames" you wanna delete is "MSysObjects".

The Access security is denying you access to open/query it.

It is a security feature of Access.

I don't think there is any problem with it.

You should not be deleting @ all.

----- Original Message -----

From: "Eimear Flynn" <flynneimear@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, February 13, 2002 10:59 PM

Subject: [asp_databases] Re: contents of query to a drop down menu





> > What is the error?

>

> This is my error. Have a look and see what you think :

>

>

>

> Please select the name of the table you would like to delete :

>

> Table

>

> Microsoft OLE DB Provider for ODBC Drivers error '80040e09'

>

> [Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no

> read permission on 'MSysObjects'.

>

> /prjcsm3021/Project/DeleteTable.asp, line 146

>

>

>

> Line 146 of the asp page is :

>

> objRS.open "QryTableNames", objConn, adOpenforwardonly, adlockreadonly,

> adCmdStoredProc

>

>




$subst('Email.Unsub').



Message #5 by Thomas Bellavia <TBellavia@V...> on Thu, 14 Feb 2002 09:26:26 -0500
You're opening the recordset as read only 'adLockReadOnly'. If you try

DELETE or UPDATE you will get an error.



-----Original Message-----

From: Eimear Flynn [mailto:flynneimear@h...] 

Sent: Wednesday, February 13, 2002 6:00 PM

To: ASP Databases

Subject: [asp_databases] Re: contents of query to a drop down menu



> What is the error?



This is my error. Have a look and see what you think :







Please select the name of the table you would like to delete :



Table 



Microsoft OLE DB Provider for ODBC Drivers error '80040e09' 



[Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no 

read permission on 'MSysObjects'. 



/prjcsm3021/Project/DeleteTable.asp, line 146 







Line 146 of the asp page is : 



objRS.open "QryTableNames", objConn, adOpenforwardonly, adlockreadonly, 

adCmdStoredProc








$subst('Email.Unsub').


  Return to Index