Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to a database on a network

Status
Not open for further replies.

Anthony1312002

Programmer
Mar 4, 2004
146
US
Hope someone can help me. Is there a way to connect to a database that I have on a network drive using ASP? The server I'm using is IIS.
 
Are you getting an error when you try to connect to it at the moment? Is the drive mapped on the webserver?

Tony
________________________________________________________________________________
 
This is the error I'm getting

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.



Here is the connection I'm using. As you can see it's a DSN But should that matter? The database is located on the network directory I:\clt\DatabaseBackup\SiteBackend.mdb

Set Conn = Server.CreateObject ("ADODB.Connection")
conn.open "RemitcoDSN"
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = Conn
 
dsn or not, if someone's got the db open in Access or otherwise ( like thru rdo or something working with vb/dll's whatever ) the db will be locked.

when you assign a db as a dsn it should be thrown into the blackness of data sourceness, and should be "forgotten" about in order to avoid these conflicts.

[thumbsup2]DreX
aKa - Robert
 
Drex is right. Ensure no one has it open and then try to connect. If it still does not work you may have to change some permissions. Personally, Id create a small access db on your local machine first and try to connect to it. If it works, at least you know it isnt your code...
 
Thanks for the responses. The DSN that I'm using works great on my local drive. It's when I take that same db and put it on the network and then try to connect to it that I get the error. I've checked to see if anyone else had it open and found that I'm the only one using it. Any further thoughts as to how I can accomplish the connection? Changing permissions was mentioned. On my machine I'm listed and the admin. What do I need to do further?
 
IUSR account needs change permissions on the folder

[thumbsup2]DreX
aKa - Robert
 
you will need administor privs on the hosting machine, in order to change the folder's permissions and yes, on the folder housing the database, where ever that might be.

[thumbsup2]DreX
aKa - Robert
 
What would I need to change the permissions to? I'm sorry but my experience in this is a bit limited.
 
You'll need to grant IUSER_MACHINENAME to have read/write permission on the directory the database is in in the file system. Basically, right click the folder the directory is in, go to add user, add the IUSER user, and grant them read/write permissions to that folder in the file system....that should do the trick i think...
 
you need "change" permissions otherwise on older OS's known as modify permissions, RWD permissions.
the db has to be able to be read, needs to be write a temp file ( .lbd ) and when connection is closed to be able to delete the temp file.

without these three you're stuck, and the permissions have to be on the folder, not the DB, because it's in the folder the temp file is being created/killed.

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top