Web Hosting Talk







View Full Version : Question about Access and DSN-less connections


DaveNET
12-22-2004, 01:17 AM
Hi,

I don't know much about Windows hosting, but I'm trying to learn fast because one of the servers in the host I purchased is a Windows 2003 box.

A potential client asked if my hosting service allows DSN-less connections to an Access database. I have no idea. I've been reading around and it seems this option is available by default and pretty simple to implement.

I'm running H-Sphere, in case that affects my situation.

Anyone care to offer an opinion or give me some tips on how to test this so I can find the answer?

webshome
12-22-2004, 03:28 AM
hi there,

use below code for dsnless connection with access

oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;" & _
"Uid=admin;" & _
"Pwd="


Regards
Webshome

Corey Bryant
12-22-2004, 09:25 AM
And here is one more:
strDataPath = "D:\domains\domain.com\db\filename.mdb"
set objConnection=Server.CreateObject("ADODB.Connection")
strConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;"_
+ " Data Source= " & strDataPath & ";"_
+ " Mode=Share Deny None;User Id=admin;PASSWORD=;"
objConnection.ConnectionTimeout = 15
objConnection.CommandTimeout = 10
objConnection.Mode = 3 'adModeReadWrite
if objConnection.state = 0 then
objConnection.Open strConnectString
end if

DaveNET
12-22-2004, 10:04 AM
Hi guys,

I'm sort of new at this. It seems to do DSN-less connections, you just place your Access file into a directory and then you can set up the DSN-less connection without any further 'configuration' except to write your code correctly, is that right? There's no special settings required on the control panel or host? Are these sort of basic assumptions for Windows hosting?

Corey Bryant
12-22-2004, 10:16 AM
For security reasons, I would put the DB in a folder that is not accessible from the web and make sure it has the proper read/write permissions

DaveNET
12-22-2004, 10:48 AM
So if I understand you correctly, the user determines what directory they are putting the DB into, but they should put it into a non-web accessible directory for security reasons? Other than that, they just have to know how to write their code correctly and things should work fine, right?

David

Corey Bryant
12-22-2004, 11:19 AM
Yes - correct :)