Connecting to a different database

J

jimt

I have a website up and working and an ASP page that is used as an include
file to connects to an Access-2000 DB. I'm using Frontpage-2000 and FP
extensions. The original DB I set up was an extract of a local DB. I'm
finding that I'm now using most of the tables in the DB so I would like to
simply use the full local DB instead of the extract.

The both DB, town4web.mdb (original) and town.mdb are store in a "peer"
directory to the public directory on the host to the public to provide
security for the DB. I have imported the town (full DB) into FP and store the
DB in the same directory as town4web (same directory structure as the host).
I have verified both DB connections under the Tools-Web Setting menu.

Below is the connection ASP page used as an include in all of the other ASP
to get data from the DB. The ASP with the "town4web.mdb" commented out and
the "town.mdb" not commented does not work (error "can display the page
error". If I comment out the section related to the "town.mdb" and remove the
comment lines for "town4web.mdb" the code works fine. As you can see the two
sections are identical other than the name of the DB.

Any suggestions/help?
Thanks

<%
'Option Explicit
'Dim connOLEDB (dim in a preceeding include)
'Dim strConn (dim in a preceeding include)

Set connOLEDB = Nothing

Set connOLEDB=server.createobject("adodb.connection")

'Web -OLE using town4web.mdb
'-------------------------------------------
'strConn = "Provider=Microsoft.Jet.OLEDB.4.0; " _
' & "Data Source=" & Server.MapPath("../../databases/town4web.mdb")
'connOLEDB.Open strConn

'Web -OLE using town.mdb
'-------------------------------------------
strConn = "Provider=Microsoft.Jet.OLEDB.4.0; " _
& "Data Source=" & Server.MapPath("../../databases/town.mdb")
connOLEDB.Open strConn

%>
 
D

David Berry

If you're getting an error in the browser it may not be the connection at
all. Could it be that your other table has different field names (or
different fields) than the first DB and that's what's causing the error? In
IE go to Tools, Internet Options, Advanced and uncheck where it says to show
friendly error messages then refresh the page to see the real ASP error.

The connection strings look the same so they should work the same unless
something else is different. You don't have a Global.asa in the web that
points to the other DB do you? The include is the same on all pages?

Finally, if you aren't going to use DB1 anymore, why not delete it and
rename the second DB to the same name as the original was. Then you don't
have to change any code.
 
J

jimt

David,

Thanks for the reply. I turned of the friendly errors and got the following:
Microsoft JET Database Engine error '80040e09'

Record(s) cannot be read; no read permission on 'wowner_name_03'.

/ASP/check_logon.asp, line 32

The check_login.asp is a user security

I've checked the security in access for both the query and the underlying
table. Both DB security setting are the same.

Lost... appreciate any additional help.

Thanks
Jim T.
 
D

David Berry

What's line 32 say?

Sounds like it may just be a permissions issue on the server with the
database. Check with your web host and make sure the IUSR account (and any
other account that needs it) has the correct permissions for that database.
 
J

jimt

David,

Thank you for you continued help. The databases directory that is peer to
the public has all of the files under it set as "-RW--R--R--". I had also
check to make sure the FP Tools-Web Settngs did not have a password on the
original and not on the new DB. Both DB's do not have a ID/Pswd entered.

The new DB seem it should be a straight forward change to the include file.
If you have any additional thoughts I would greatly appreciate them, this has
really got me stumped.

Thanks
Jim T.
 
D

David Berry

What's line 32 of the code say (or what's it trying to do where it blows
up)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top