Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2006, 10:39 PM
Registered User
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accessing Linked SQL tables in Access

I have a linked table in access that is linked to SQL database. The table name is linked_table and for argument sake the db is named database. I have the following code in asp

<%@ LANGUAGE="VBSCRIPT" %>
<%response.buffer = true %>




<%
Dim objConn
Dim objRS

     application("ADOSqlConnection") = "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\somedirectory\database.mdb"

        Set objConn=Server.CreateObject("ADODB.Connection")

        objConn.Open(application("ADOSqlConnection"))

        Set objRS=Server.CreateObject("ADODB.Recordset")
    objRS.ActiveConnection=objConn

    sSQL="SELECT * FROM linked_table"
response.write ssql

        objRS.open(sSQL)

do while not objrs.EOF
response.write objrs("Commitment") & "<br>"
objrs.MoveNext
loop

    objRS.close

        Set objRS=Nothing
        objConn.Close
        set objConn=Nothing

%>

<html>
<body>
test
</body>
</html>


The code does well until it hits objRS.open(sSQL)

The error is as follows


SELECT * FROM MASTER_JCM_COMMITMENT
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

[Microsoft][ODBC Microsoft Access Driver] Could not execute query; could not find linked table.

/test.asp, line 27






Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked tables to an unavailable SQL server davehodges Access 1 January 16th, 2008 09:17 AM
Read Linked tables in Access from VB code meggan VB Databases Basics 3 March 4th, 2005 11:26 AM
Access Linked Tables StephenDID Access ASP 6 October 6th, 2003 10:08 AM
Access - Linked ODBC Tables Ben Access 0 July 24th, 2003 10:39 AM
Want to code external linked tables in Access Michael Allaire Access VBA 1 July 23rd, 2003 06:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.