Posted on 2005-04-26
What i am trying to do is use the following piece of code to access any database (i.e. oracle, access, mysql, sql server) and run through each table in the database and retrieve each table and its primary key. The problem is when it comes to using it with access, if i use the following connection string "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=......" the scipt runs fine, but if i use an ODBC connection for the same database which has been added to the system DSN, using the following string "DSN=Test" i get the following error "Object or provider is not capable of performing requested".
Set dbConn = Server.CreateObject("ADODB.Connection")
Set rsA = dbConn.OpenSchema(20, Array(Empty, Empty, Empty, "TABLE"))
Do While Not rsA.EOF
Set rsB = dbConn.OpenSchema(28, Array(Empty, Empty, rsA("Table_Name").value)) '<--- ERROR at this line
Set rsA = Nothing
So if someone could point me in the direction of were i am going wroung that would be great.