|
 |
asp_databases thread: Access 2000 tables
Message #1 by "David Cowlin" <david.cowlin@t...> on Fri, 20 Jul 2001 12:09:11 +0200
|
|
Hi I'm trying to retrieve a list of tables currently within an Access
2000 db via ASP.
This is not hard in SQL server but I but can find no info for Access.
Any help appreciated.
Thanks
Dave
Message #2 by Steve Carter <Steve.Carter@t...> on Fri, 20 Jul 2001 11:42:51 +0100
|
|
The following code gets the tables of an Access2k db.
It's just ripped from a page of mine so it has lots of
extraneous stuff in there with it.
'''''''''''''''''''''''''''''''''''''''''''
'
' If a DSN is selected, get the tables
'
'''''''''''''''''''''''''''''''''''''''''''
if varType(Request.Form("DSN"))>1 then
dim oConn,oRs
set oConn=3Dserver.CreateObject("ADODB.Connection")
oConn.Open cstr(Request.Form("DSN"))
set oRs=3Dserver.CreateObject("ADODB.Recordset")
set ors=3DoConn.OpenSchema (adSchemaTables)
ors.MoveFirst
if ors.BOF and ors.EOF then
%>
<span color=3D"#dddddd">No Tables</span>
<%
else
%>
<select name=3D"Table" onChange=3D"form.submit();">
<%
while not ors.EOF
if oRs.Fields("TABLE_TYPE")=3D"TABLE" then%>
<option<%
if varType(Request.Form("Table"))>1 then
if Request.Form("Table")=3Dors.Fields("TABLE_NAME")
then
%> SELECTED<%
end if
end if
%>
value=3D"<%=3Dors.Fields("TABLE_NAME")%>"><%=3Dors.Fields("TABLE_NAME")
%></option>
<%
end if
oRs.MoveNext
wend
end if
ors.Close
set ors=3Dnothing
end if
%>
</TD>
> -----Original Message-----
> From: David Cowlin [mailto:david.cowlin@t...]
> Sent: 20 July 2001 11:09
> To: ASP Databases
> Subject: [asp_databases] Access 2000 tables
>
>
> Hi I'm trying to retrieve a list of tables currently within an Access
> 2000 db via ASP.
> This is not hard in SQL server but I but can find no info for Access.
> Any help appreciated.
>
> Thanks
> Dave
>
Message #3 by "Tomm Matthis" <matthis@b...> on Sat, 21 Jul 2001 11:29:04 -0400
|
|
Look into using ADOX... that will work with Access, SQL, and any other
relational datastore that you connect to via ADO.
-- Tomm
> -----Original Message-----
> From: David Cowlin [mailto:david.cowlin@t...]
> Sent: Friday, July 20, 2001 6:09 AM
> To: ASP Databases
> Subject: [asp_databases] Access 2000 tables
>
>
> Hi I'm trying to retrieve a list of tables currently within an Access
> 2000 db via ASP.
> This is not hard in SQL server but I but can find no info for Access.
> Any help appreciated.
>
> Thanks
> Dave
>
>
|
|
 |