Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: Please advise on Connection_DSNLess..


Message #1 by "Henry Kam" <hkskam@w...> on Tue, 23 Apr 2002 19:23:28
I had problem when trying the following ASP codes
(both in NT4.0 SP5 APACHE1.3.4 iASp2.0 with 2.1 msado15.dll
and in W2k SP2 APACHE 1.3.19 iASP 2.0 with 2.52.6019.1 msado.dll
 -- C:\myasp is virtual directory -- differnet directories were also tried)

<html>
<head>
<title>2726ch9 Conn - DSN-less Connections</title>
</head>
<body>
<p>Chapter 9 Connections - DSN-less Connections</p>
<hr>
<%
set oRS1=server.createobject("ADODB.recordset")
set oConn=server.createobject("ADODB.connection")
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\myasp\Sailors.mdb" 
ors1.open "Select * from People", oConn
response.write ors1("PeopleNameLast")
%>
</hr>
</body>
</html>

The error was Vbscript Runtime error 'ASP 0185 -2147467259
              Data Source nmae not found or no default driver specified

All examples with DSN setup from ODBC Data Source Administrator work!
Error also occured for examples using PROVIDED=....

Please advise..
Message #2 by "Drew, Ron" <RDrew@B...> on Tue, 23 Apr 2002 15:10:12 -0400
oConn.Open "Driver=3D{Microsoft Access Driver (*.mdb)};" & _
           "Dbq=3DC:\myasp\Sailors.mdb;" & _
           "Uid=3Dadmin;" & _
           "Pwd=3D;"
Depends on how you want to open it...take a look at...
http://www.able-consulting.com/ADO_Conn.htm#ODBCDriverForAccess

Or...
http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForMicrosoftJet

-----Original Message-----
From: Henry Kam [mailto:hkskam@w...]
Sent: Tuesday, April 23, 2002 3:23 PM
To: ASP Database Setup
Subject: [asp_database_setup] Please advise on Connection_DSNLess..


I had problem when trying the following ASP codes
(both in NT4.0 SP5 APACHE1.3.4 iASp2.0 with 2.1 msado15.dll
and in W2k SP2 APACHE 1.3.19 iASP 2.0 with 2.52.6019.1 msado.dll
 -- C:\myasp is virtual directory -- differnet directories were also
tried)

<html>
<head>
<title>2726ch9 Conn - DSN-less Connections</title>
</head>
<body>
<p>Chapter 9 Connections - DSN-less Connections</p>
<hr>
<%
set oRS1=3Dserver.createobject("ADODB.recordset")
set oConn=3Dserver.createobject("ADODB.connection")
oConn.Open "DRIVER=3D{Microsoft Access Driver
(*.mdb)};DBQ=3DC:\myasp\Sailors.mdb"
ors1.open "Select * from People", oConn
response.write ors1("PeopleNameLast")
%>
</hr>
</body>
</html>

The error was Vbscript Runtime error 'ASP 0185 -2147467259
              Data Source nmae not found or no default driver specified

All examples with DSN setup from ODBC Data Source Administrator work!
Error also occured for examples using PROVIDED=3D....

Please advise..
%%email.unsub%%

Message #3 by "Henry Kam" <hkskam@w...> on Thu, 25 Apr 2002 20:43:41
Ron,

I did try those in your suggested URLs...
And got the same errors...

I thought those examples in the books should be corrected....
I wished the error message should be able to distinquish the Data source name not found
or no default driver specified ( just one error!!) ...
The thing bother me is that all examples with DSN defined by ODBC data source
are working.. I think there must be some permission problem...I put sailors.mdb
in different directory and change corresponding in my asp file and still got
the same error...

Please advise as what to do next....

Thx,
Henry







Or...
http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForMicrosoftJet

Message #4 by "Drew, Ron" <RDrew@B...> on Thu, 25 Apr 2002 16:55:46 -0400
Go to the directory for sailors.mdb and right click on the directory, do
a properties and look at the security.  Make sure EVERYONE has
write/update and not just read only.

-----Original Message-----
From: Henry Kam [mailto:hkskam@w...]
Sent: Thursday, April 25, 2002 4:44 PM
To: ASP Database Setup
Subject: [asp_database_setup] RE: Please advise on Connection_DSNLess..


Ron,

I did try those in your suggested URLs...
And got the same errors...

I thought those examples in the books should be corrected....
I wished the error message should be able to distinquish the Data source
name not found or no default driver specified ( just one error!!) ...
The thing bother me is that all examples with DSN defined by ODBC data
source are working.. I think there must be some permission problem...I
put sailors.mdb in different directory and change corresponding in my
asp file and still got the same error...

Please advise as what to do next....

Thx,
Henry







Or...
http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForMicrosoftJet

%%email.unsub%%

Message #5 by "Henry Kam" <hkskam@w...> on Mon, 29 Apr 2002 17:00:47
> Go to the directory for sailors.mdb and right click on the directory, do
>a properties and look at the security.  Make sure EVERYONE has
>write/update and not just read only.

I tried the followings: 1. copy sailors2.mdb to c:\
                        2. define DSN=Sailors2 which points to c:\sailors2.mdb from
                           ODBC Data Source Administration
                        3. First part of the following script works
                        4. copy Sailors2.mdb to c:\0asp
                        5. the permissions on c:\0asp and c:\0asp\Sailors2.mdb
                           are Full Control/Modify/Read&Execute/list Folder Contents/Read/Write
                        6. The followings are added to httpd.conf in APACHE
                           <Directory "C:\0asp">
                           Options Indexes FollowSymLinks MultViews
                           AllowOverride None
                           Order allow deny
                           Allow from all
                          </Directory>
                          Alias /myasp "C:\0asp"
                        7. The second part of the DSN-less does not work--Error occurs at
oConn2.open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=c:\0asp\Sailors2.mdb"

Vbscript Runtime error 'ASP 0185: -2147467259'
Data source name not found or no default driver specified

I would be much appreciated for any suggestion....
Again I tried the codes in NT4.0/Sp5 Apache iASP msado15.dll(2.1) without Access and 
  in W2K/Sp2 Apache iASP msado15.dll(2.52.6019.1) With/Without MsAccess 2000 installed
 
Thx
Henry



<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<P>FROM HTML</P>
<%
Response.Write "From ASP"
%>
<BR>
<%
dim oConn1
dim ors1
set oConn1 = server.createobject("adodb.connection")
set ors1 = server.CreateObject("adodb.recordset")
oConn1.open "DSN=sailors2"
ors1.Open "people", oConn1
Response.Write ors1("PeopleNameFirst")
%>
<br>
<%
dim oConn2
dim ors2
set oConn2 = server.createobject("adodb.connection")
set ors2 = server.CreateObject("adodb.recordset")
oConn2.open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=c:\0asp\Sailors2.mdb"
ors2.Open "people", oConn2
Response.Write ors2("PeopleNameFirst")
%>
</BODY>
</HTML>




Message #6 by "Drew, Ron" <RDrew@B...> on Mon, 29 Apr 2002 15:58:37 -0400
OK try this..go into Windows Explorer and find your web directory
something like C:\Inetpub\wwwroot\ ..this is where your index.htm or
default.htm normally is.  Now in Windows Explorer create a directory
under it called "database". Copy the Sailors2.mdb into the new
directory.  Once created and mdb copied, right click on the directory
and select Properties,  another window will appear.  Pick the Security
tab.  Look for "Everyone" and make sure that role has full control.  If
Everyone is not shown, add it.

-----Original Message-----
From: Henry Kam [mailto:hkskam@w...]
Sent: Monday, April 29, 2002 1:01 PM
To: ASP Database Setup
Subject: [asp_database_setup] RE: Please advise on Connection_DSNLess..


> Go to the directory for sailors.mdb and right click on the directory,
>do a properties and look at the security.  Make sure EVERYONE has
>write/update and not just read only.

I tried the followings: 1. copy sailors2.mdb to c:\
                        2. define DSN=3DSailors2 which points to
c:\sailors2.mdb from
                           ODBC Data Source Administration
                        3. First part of the following script works
                        4. copy Sailors2.mdb to c:\0asp
                        5. the permissions on c:\0asp and
c:\0asp\Sailors2.mdb
                           are Full Control/Modify/Read&Execute/list
Folder Contents/Read/Write
                        6. The followings are added to httpd.conf in
APACHE
                           <Directory "C:\0asp">
                           Options Indexes FollowSymLinks MultViews
                           AllowOverride None
                           Order allow deny
                           Allow from all
                          </Directory>
                          Alias /myasp "C:\0asp"
                        7. The second part of the DSN-less does not
work--Error occurs at oConn2.open "Driver=3D{Microsoft Access Driver
(*.mdb)}; DBQ=3Dc:\0asp\Sailors2.mdb"

Vbscript Runtime error 'ASP 0185: -2147467259'
Data source name not found or no default driver specified

I would be much appreciated for any suggestion....
Again I tried the codes in NT4.0/Sp5 Apache iASP msado15.dll(2.1)
without Access and
  in W2K/Sp2 Apache iASP msado15.dll(2.52.6019.1) With/Without MsAccess
2000 installed

Thx
Henry



<%@ Language=3DVBScript %>
<HTML>
<HEAD>
<META NAME=3D"GENERATOR" Content=3D"Microsoft Visual Studio 6.0"> 
</HEAD>
<BODY> <P>FROM HTML</P> <% Response.Write "From ASP" %> <BR> <% dim
oConn1 dim ors1 set oConn1 =3D server.createobject("adodb.connection")
set ors1 =3D server.CreateObject("adodb.recordset")
oConn1.open "DSN=3Dsailors2"
ors1.Open "people", oConn1
Response.Write ors1("PeopleNameFirst")
%>
<br>
<%
dim oConn2
dim ors2
set oConn2 =3D server.createobject("adodb.connection")
set ors2 =3D server.CreateObject("adodb.recordset")
oConn2.open "Driver=3D{Microsoft Access Driver (*.mdb)};
DBQ=3Dc:\0asp\Sailors2.mdb" ors2.Open "people", oConn2 Response.Write
ors2("PeopleNameFirst") %> </BODY> </HTML>




---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D20 to
unsubscribe send a blank email to 
%%email.unsub%%

Message #7 by "Henry Kam" <hkskam@w...> on Tue, 30 Apr 2002 00:10:45
> OK try this..go into Windows Explorer and find your web directory
>something like C:\Inetpub\wwwroot\ ..this is where your index.htm or
>default.htm normally is.  Now in Windows Explorer create a directory
>under it called "database". Copy the Sailors2.mdb into the new
>directory.  Once created and mdb copied, right click on the directory
>and select Properties,  another window will appear.  Pick the Security
>tab.  Look for "Everyone" and make sure that role has full control.  If
>Everyone is not shown, add it.

Since I run APACHE and iASP, will it be the problem...the root directory for
APACH is not c:\InetPub\wwwroot...
I even use mappath("Sailors.mdb") in my script and it return the correct path

Also I did try to put Sailors.mdb to APACHE root and still get the same error..

I'm sorry keeping bother you...Any other suggestion...

Thx
Henry

  Return to Index