Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 3rd, 2006, 10:39 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:44 PM.


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