Click to See Complete Forum and Search --> : DB connectivity


jola
04-06-2004, 03:38 AM
I have a problem with connecting to the DB that resides like all my asp files on web server(which is not my local machine)

I use thi connection string:
objConn.Open Provider="Microsoft.Jet.OLEDB.4.0; Data Source = C:\inetpub\wwwroot\Intranet\SomeAPP\Data\DataMEIC.mdb;Mode=ReadWrite;Persist Security Info=False"

the answer that I get is:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Can anybody help me to solve this problem,because whenever i work localy I do not have that problem
Is there some adjucement that administratot should do with the web server?

thank's JOLA

buntine
04-06-2004, 06:20 AM
The directory you are pointing to probably doesnt exist on the server...

Use the mapPath() method when deading with literal file paths.

Dim strFile
strFile = "subdir\DataMEIC.mdb"

objConn.Open Provider="Microsoft.Jet.OLEDB.4.0; Data Source = " & Server.MapPath(strFile) & ";Mode=ReadWrite;Persist Security Info=False"


Have the strFile variable point to the database file. subdir refers to the sub-directory which you keep all your database files in. If you leep the database in the same direcory as the page, just have the filename in the variable.

Regards,
Andrew Buntine.

jola
04-06-2004, 09:58 AM
I tried
Dim strFile
strFile = "\Gustav\wwwroot\Intranet\rabotniAPP\Data\DataMEIC.mdb"

objConn.Open Provider="Microsoft.Jet.OLEDB.4.0; Data Source = " & Server.MapPath(strFile) & ";Mode=ReadWrite;Persist Security Info=False"

and it doesn't work
I realy do not know what is the problem.
Do u think that i should put the data base in a diferent folder, instead the folder that contains my asp files

buntine
04-06-2004, 10:02 AM
Whats the server url of the directory which your ASP files reside in?

jola
04-07-2004, 04:51 AM
urs is:
http://intranet/moepp.gov.mk/rabotniAPP/asp/loginForm.asp
is the first file.
And the DB is in the same folder asp in subfolder Data

Do u think that I should put the DB in some other folder, for example like:
c:\inetpub\wwwroot\Intranet\Data\some_DB.mdb

buntine
04-07-2004, 06:02 AM
Set the variable value to this.

strFile = "Intranet\SomeAPP\Data\DataMEIC.mdb"

jola
04-07-2004, 09:05 AM
It doesn't work that way eather.
The whole code works with PWS, but with IIS 5.0 it doesn't.
thatnk's anyway