retrieve datamodel in Access DB in ASP using ADO

retrieve datamodel in Access DB in ASP using ADO

Post by Jan Geyse » Tue, 28 Mar 2000 04:00:00



I want to retrieve datamodel (tables, columns, PK, FK, ...) from Access DB
in ASP using ADO

Till now, I didn't manage to retrieve the primary keys defined in Access

apparently the connection.OpenSchema(adSchemaPrimaryKeys) isn't supported
for Access (jet)
nor is there a MSys<table> in Access where the primary key definitions are
kept

Any idea ??

regards
Jan

 
 
 

retrieve datamodel in Access DB in ASP using ADO

Post by Peter Daniel » Fri, 31 Mar 2000 04:00:00


Jan,

If you can somehow also use DAO, you can use the
TableDef.Indexes(index).Primary boolean property, then use the Fields
collection of that index...

I have found that much of the code I thought could be handled by ADO or ADOX,
still has to be handled by DAO.

I often have to use code like:

Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
... (open the connection)

Dim db As DAO.Database
Set db = OpenDatabase(conn.Properties("Data Source"))

Dim tdef As DAO.TableDef
Dim index As DAO.Index

For each tdef in db.TableDefs
    For each index in tdef.Indexes
        If index.Primary = True Then
            <processing>
        End if
    Next
Next

I hope that the OLE DB providers (and their ADOX functionality) will get
better in the future.  For now, sometimes DAO is still the way to go.

If anyone else has a better solution for me, please let me know - I'd love to
see this work without DAO.

Cheers,

-Peter


> I want to retrieve datamodel (tables, columns, PK, FK, ...) from Access DB
> in ASP using ADO

> Till now, I didn't manage to retrieve the primary keys defined in Access

> apparently the connection.OpenSchema(adSchemaPrimaryKeys) isn't supported
> for Access (jet)
> nor is there a MSys<table> in Access where the primary key definitions are
> kept

> Any idea ??

> regards
> Jan

--
Peter Daniels
Husband, Database Jedi, Avs fan

 
 
 

1. Problem using VB to retrieve ASP/XML using ADO recordset

Hello,

I've read about ADO url recordset connections, but somehow can't get
this simple example working:

Dim strConnection               As String
Dim myRecordset                 As ADODB.Recordset

Set myRecordset = New ADODB.Recordset
myRecordset.Open "http://computercity.dyndns.org/test.xml", , _
                  adOpenStatic, adLockBatchOptimistic

myRecordset.Close
Set myRecordset = Nothing

The ASP referenced above is a simple XML file as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
</note>

When running the VB app, following error occurs on the myRecordset.Open
command line:

Run Time Error 3709 - The connection cannot be used to perform this
operation. It is either closed, invalid or incorrect.

I have tried opening an ADODB.connection first and inserting this one in
the recordset.open line, but no success.

Please help!!!

Regards,
Kris

2. FREE: Sun Ingres Manual Set, Version 5.0

3. ASP script: ADO query using Access db

4. Tracking Articles,Ideas & Tips

5. ASP, ADO, Access DB = err 80040E09 'Can't update DB. Read Only

6. Can I INSERT Into multiple tables from multiple tables in one query?

7. Retrieving OLE DB provider datatype support using ADO

8. Converting Unicode string to Ascii?

9. Retrieving Field descriptions from Access table using ADO

10. Retrieving Access database Field descriptions using ADO

11. Retrieving an embeded bitmap from an access db using ODBC

12. Writing to access db through ASP/ADO