Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Creating a linked table on remote Access database through ASP/VBScript

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-07-03, 06:47
kaeldowdy kaeldowdy is offline
Member
 
Join Date: Apr 2003
Location: Evansville, Indiana
Posts: 75
Question Creating a linked table on remote Access database through ASP/VBScript

I'm wondering if any one had success in creating a linked/attached table on an MS Access database once it is on a webserver.

Say I have two Access databases, and I want to create a linked table in one of them to look at a table in the other. I cannot create the linked table using the UNC path for the folder on the webserver containing the databases b/c it doesn't exist on my local machine. I want to either issue some type of SQL command (which I don't think is possible) or use VBScript to modify the Access db and establish the linked table.

I tried this on my local machine using IIS and it worked, but once I uploaded the dbs to the webserver and opened the same ASP document in my browser, I get a "HTTP 500 Internal server error".

Here's the code I made to do this which worked locally using a UNC path:
Code:
<% Dim oAccessApp ' access object variable name ' instantiate the access object variable with an instance of the destination database ' in the web server's memory so you can create a linked table... ' Arguments: ' UNC path of destination database (where you want to link the table to), ' class name of object you want to instantiate Set oAccessApp = GetObject("\\WebServerName\Folder1\...\database\dbDestination.mdb", "Access.Application") ' call the TransferDatabase method to link the table ' Arguments: ' TransferType - linked table transfer (acLink = A_ATTACH = 2), ' DatabaseType - Microsoft Access in this case, ' DatabaseName - UNC path of source database (where you want to link the table from), ' ObjectType - the type of object you want to reference.. ' a table in this case (acTable = A_TABLE = 0), ' Source - name of the table you want to link from, ' Destination - name of the table you want to link to ' (can be same or different than Source), ' StructureOnly - boolean argument whether you want either the structure ' or structure and data (False in this case) oAccessApp.DoCmd.TransferDatabase 2, "Microsoft Access", _ "\\WebServerName\Folder1\...\database\dbSource.mdb", _ 0, "tblData", "tbldata", False ' release the instance of the access object Set oAccessApp = Nothing %>
As you can see, there are few lines of code to do this, and is pretty cut and dry.

Again, this works locally, but when I run the same script on the webserver (with the appropriate UNC paths), I get that 500 error.

I don't know if there may be a different way to do this, or if there is some setting the webserver has that doesn't allow this (that's what I am thinking, but not sure.)

I remember responding to a post (I don't remember if it was here or on the newsgroups) about the same topic, so I don't know if that person had success or not...I know this isn't a unique situation, but I may have limitations with the web host.

Any ideas??

Kael

Last edited by kaeldowdy : 04-07-03 at 11:48.
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

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