|
 |
asp_databases thread: Pesky Access connection refuses to work
Message #1 by Andy Johnson <lysaer@d...> on Tue, 26 Sep 2000 08:56:36 -0500
|
|
Good morning, everyone.
I've got an access database that I'm trying to make a connection to, and
failing in every attempt. I've tried 7 different connection strings, all
DSN-less, and nothing seems to want to work. This is on an NT IIS
server, latest version. The database is an Access 97 mdb file, and at
present time only contains one table with 2 records (just to get the code
working).
Any suggestions?
The response I repeatedly get when I test the page making the connection
is:
An error occurred on the web-site when processing the script. Please
contact the site administrator.
I've talked with my site admin extensively, and he can't figure out what
the trouble is, but near as he can tell the connection's
not...well..connecting.
Thanks!
Message #2 by "Jason A. Greenfeld" <jgreenfeld@r...> on Tue, 26 Sep 2000 11:25:19 -0400
|
|
Can you post the code you are using?
1 thing you may want to do is try connecting using a DSN. This is so you can
see if you are even able to connect to the db at all.
Jason Greenfeld
Rubicon Technologies, Inc.
http://www.rubicontechnologies.com
-----Original Message-----
From: Andy Johnson [mailto:lysaer@d...]
Sent: Tuesday, September 26, 2000 9:57 AM
To: ASP Databases
Subject: [asp_databases] Pesky Access connection refuses to work
Good morning, everyone.
I've got an access database that I'm trying to make a connection to, and
failing in every attempt. I've tried 7 different connection strings, all
DSN-less, and nothing seems to want to work. This is on an NT IIS
server, latest version. The database is an Access 97 mdb file, and at
present time only contains one table with 2 records (just to get the code
working).
Any suggestions?
The response I repeatedly get when I test the page making the connection
is:
An error occurred on the web-site when processing the script. Please
contact the site administrator.
I've talked with my site admin extensively, and he can't figure out what
the trouble is, but near as he can tell the connection's
not...well..connecting.
Thanks!
---
To place your message here, or to sponsor this list, please e-mail
mailto:p2pinfo@w...?subject=MediaPack, remembering to provide contact
details for yourself. We will e-mail you a Media Pack within 24 hours.
You are currently subscribed to asp_databases
---
Message #3 by "Ariel Comstock" <Ariel.Comstock@b...> on Tue, 26 Sep 2000 10:24:52 -0500
|
|
Andy,
Are you using an error object? If you use one you might be able to get
more accurate (and helpful) messages. Another thing to try is to check
to see if the "friendly HTTP messages" are turned off on your browser in
another attempt to get better messages. Then you can send the errors
back here and more help can be offered.
HTH to start...
ariel 8:)
-----Original Message-----
From: Andy Johnson [mailto:lysaer@d...]
Sent: Tuesday, September 26, 2000 8:57 AM
To: ASP Databases
Subject: [asp_databases] Pesky Access connection refuses to work
Good morning, everyone.
I've got an access database that I'm trying to make a connection to, and
failing in every attempt. I've tried 7 different connection strings, all
DSN-less, and nothing seems to want to work. This is on an NT IIS
server, latest version. The database is an Access 97 mdb file, and at
present time only contains one table with 2 records (just to get the
code
working).
Any suggestions?
The response I repeatedly get when I test the page making the connection
is:
An error occurred on the web-site when processing the script. Please
contact the site administrator.
I've talked with my site admin extensively, and he can't figure out what
the trouble is, but near as he can tell the connection's
not...well..connecting.
Thanks!
---
To place your message here, or to sponsor this list, please e-mail
mailto:p2pinfo@w...?subject=3DMediaPack, remembering to provide
contact details for yourself. We will e-mail you a Media Pack within 24
hours.
You are currently subscribed to asp_databases
$subst('Email.Unsub')
---
Message #4 by Andy Johnson <lysaer@d...> on Tue, 26 Sep 2000 11:35:35 -0500
|
|
This is the current code I'm trying.
<%
ConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=d:\www\kadanzer\www\kaz.mdb"
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
'Define a recordset
'RS = Server.CreateObject("ADODB.recordset")
SQL = " SELECT Picture_ID"
SQL = SQL & " FROM tblGallery"
SQL = SQL & " ORDER BY File_Title"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.open SQL, ConnString
RS.MoveFirst
'end define a recordset code
response.write SQL
%>
"Jason A. Greenfeld" wrote:
> Can you post the code you are using?
>
> 1 thing you may want to do is try connecting using a DSN. This is so you can
> see if you are even able to connect to the db at all.
>
> Jason Greenfeld
> Rubicon Technologies, Inc.
> http://www.rubicontechnologies.com
>
> -----Original Message-----
> From: Andy Johnson [mailto:lysaer@d...]
> Sent: Tuesday, September 26, 2000 9:57 AM
> To: ASP Databases
> Subject: [asp_databases] Pesky Access connection refuses to work
>
> Good morning, everyone.
>
> I've got an access database that I'm trying to make a connection to, and
> failing in every attempt. I've tried 7 different connection strings, all
> DSN-less, and nothing seems to want to work. This is on an NT IIS
> server, latest version. The database is an Access 97 mdb file, and at
> present time only contains one table with 2 records (just to get the code
> working).
>
> Any suggestions?
>
> The response I repeatedly get when I test the page making the connection
> is:
> An error occurred on the web-site when processing the script. Please
> contact the site administrator.
>
> I've talked with my site admin extensively, and he can't figure out what
> the trouble is, but near as he can tell the connection's
> not...well..connecting.
>
> Thanks!
>
Message #5 by Andy Johnson <lysaer@d...> on Tue, 26 Sep 2000 11:39:36 -0500
|
|
How do I put in an error object? Please be a little patient with me...I
just started learning ASP a week ago at work, and everything's been
running fine there...but this personal site seems to be a real
frustration! Argh! :)
I spent some time on the phone with my administrator, and he ran an asp
code checker on the page...we've eliminated all the code inside the page
just in an attempt to get the connection and recordset defined...and
his checker doesn't find anything. The conclusion we've come to is that
the connection's not being made, and the browser/server aren't getting
enough information to attempt to define the error. :(
The error I posted is the one that I get in Netscape. In IE 5.5 I
get "The page cannot be displayed..." "HTTP 500 - Internal server error "
That help any?
Ariel Comstock wrote:
> Andy,
>
> Are you using an error object? If you use one you might be able to get
> more accurate (and helpful) messages. Another thing to try is to check
> to see if the "friendly HTTP messages" are turned off on your browser in
> another attempt to get better messages. Then you can send the errors
> back here and more help can be offered.
>
> HTH to start...
>
> ariel 8:)
>
Message #6 by "Ken Schaefer" <ken@a...> on Wed, 27 Sep 2000 11:27:54 +1000
|
|
Andy,
Get your system admin to allow "detailed error messages" to be sent to the
client (website properties, application configuration, application
debugging), rather than the catch all bland message that you're getting at
the moment (also make sure that you have "friendly error messages" turned
off in IE, if that's what you are using). This will allow you to see which
line your error is occuring on. It might just be that you are missing a , or
a ) somewhere, and that syntax error is tripping everything up...
With your code below, there's a couple of little problems...
a) You open a connection object, but you don't use it when opening your
recordset. You should be doing this instead:
objRS.Open SQL, my_Conn
b) You don't need objRS.movefirst. When you open a recordset you are always
at the first record. Attempting to do objRS.movefirst with a cursor that
does not support backwards scrolling, or with a recordset where .BOF and
.EOF is true, will cause an error.
c) You should probably update to OLEDB:
http://www.adOpenStatic.com/faq/whyOLEDB.asp
http://www.adOpenStatic.com/faq/OLEDBconnection.asp
Cheers
Ken
----- Original Message -----
From: "Andy Johnson" <lysaer@d...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, September 27, 2000 2:35 AM
Subject: [asp_databases] RE: Pesky Access connection refuses to work
> This is the current code I'm trying.
>
> <%
>
>
> ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};
DBQ=d:\www\kadanzer\www\kaz.mdb"
> set my_conn= Server.CreateObject("ADODB.Connection")
> my_Conn.Open ConnString
>
>
> 'Define a recordset
> 'RS = Server.CreateObject("ADODB.recordset")
> SQL = " SELECT Picture_ID"
> SQL = SQL & " FROM tblGallery"
> SQL = SQL & " ORDER BY File_Title"
> Set RS = Server.CreateObject("ADODB.Recordset")
> RS.open SQL, ConnString
> RS.MoveFirst
> 'end define a recordset code
> response.write SQL
> %>
>
Message #7 by Imar Spaanjaars <Imar@S...> on Tue, 26 Sep 2000 20:48:47 +0200
|
|
Not sure if it is the solution to your problem but I have noticed the
following.
First, in your first lines, you open a connection object with a connection
string. Then when you open the recordset, you don't use this object, but
again the connection string instead.
Try this:
RS.open SQL, my_Conn
or eliminate the whole creation of the Connection Object altogether and
just use the connection string as a parameter for the recordset. ADO will
implicitly create the connection for you.
Second, you might want to change the way you build your connectionstring /
open your connection.
Check Ken's site for more details:
http://www.adopenstatic.com/FAQ/OLEDBConnection.asp for the article on
oledb, or http://www.adopenstatic.com/ for the complete site.
And last, the error you give sounds like IIS is configured to send a boring
message to the client instead of the actual error.
Open the IIS MMC, get the properties of the website, and check the home
directory tab, click configuration and then the App debugging tab. Make
sure Send detailed ASP error messages to client is selected.
HtH
Imar
At 11:35 AM 9/26/2000 -0500, you wrote:
>This is the current code I'm trying.
>
><%
>
>
>ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};
>DBQ=d:\www\kadanzer\www\kaz.mdb"
>set my_conn= Server.CreateObject("ADODB.Connection")
>my_Conn.Open ConnString
>
>
> 'Define a recordset
>'RS = Server.CreateObject("ADODB.recordset")
>SQL = " SELECT Picture_ID"
>SQL = SQL & " FROM tblGallery"
>SQL = SQL & " ORDER BY File_Title"
>Set RS = Server.CreateObject("ADODB.Recordset")
>RS.open SQL, ConnString
>RS.MoveFirst
>'end define a recordset code
>response.write SQL
> %>
>
>
>"Jason A. Greenfeld" wrote:
>
> > Can you post the code you are using?
> >
> > 1 thing you may want to do is try connecting using a DSN. This is so
> you can
> > see if you are even able to connect to the db at all.
> >
> > Jason Greenfeld
> > Rubicon Technologies, Inc.
> > http://www.rubicontechnologies.com
> >
> > -----Original Message-----
> > From: Andy Johnson [mailto:lysaer@d...]
> > Sent: Tuesday, September 26, 2000 9:57 AM
> > To: ASP Databases
> > Subject: [asp_databases] Pesky Access connection refuses to work
> >
> > Good morning, everyone.
> >
> > I've got an access database that I'm trying to make a connection to, and
> > failing in every attempt. I've tried 7 different connection strings, all
> > DSN-less, and nothing seems to want to work. This is on an NT IIS
> > server, latest version. The database is an Access 97 mdb file, and at
> > present time only contains one table with 2 records (just to get the code
> > working).
> >
> > Any suggestions?
> >
> > The response I repeatedly get when I test the page making the connection
> > is:
> > An error occurred on the web-site when processing the script. Please
> > contact the site administrator.
> >
> > I've talked with my site admin extensively, and he can't figure out what
> > the trouble is, but near as he can tell the connection's
> > not...well..connecting.
> >
> > Thanks!
> >
>
Message #8 by "Ariel Comstock" <Ariel.Comstock@b...> on Tue, 26 Sep 2000 14:21:54 -0500
|
|
Andy-
With your error object, start by creating it using ADODB.Error using the
Server.CreateObject method. Also, create your connection. If there are
errors, then you should be able to loop through them using the Count and
description properties.
Here's a <snip> that might get you started. There's also a generic
error routine in Beg ASP 3.0 on p. 502 and an entire chapter on it
(chapter 7) Active Server Pages 3.0 Professional.
<snip>
Set objError =3D Server.CreateObject("ADODB.Error")
Set objConn =3D Server.CreateObject("ADODB.Connection")
objConn.CommandTimeout =3D 30
objConn.ConnectionTimeout=3D 30
objConn.Open Application("dsn_name"), "", ""
Set objCmdTemp.ActiveConnection =3D objConn
objCmdTemp.CommandText =3D "StoredProc"
objCmdTemp.CommandType =3D adCmdStoredProc
objCmdTemp.Execute
If objConn.Errors.Count > 0 then
Response.Write "There has been an error submitting your application."
Response.Write "Error: " & objError.Description
Response.Write "Please contact the office for assistance with this
message."
Exit Sub
End If
</snip>
******** dogging those friendly IE messages ************
sure, that message helps. 8:)
To see the more elaborate/helpful error messages in IE, go to Tools -->
Internet Options and click on the "Advanced" tab. In the "Browsing"
section, scroll down to "Show friendly HTTP error messages". That
should help. I kept getting that pesky error last week at my beta test
and this is how i determined where to look for the errors in my code.
hth.......
ariel 8:)
-----Original Message-----
From: Andy Johnson [mailto:lysaer@d...]
Sent: Tuesday, September 26, 2000 11:40 AM
To: ASP Databases
Subject: [asp_databases] RE: Pesky Access connection refuses to work
How do I put in an error object? Please be a little patient with me...I
just started learning ASP a week ago at work, and everything's been
running fine there...but this personal site seems to be a real
frustration! Argh! :)
I spent some time on the phone with my administrator, and he ran an asp
code checker on the page...we've eliminated all the code inside the page
just in an attempt to get the connection and recordset defined...and
his checker doesn't find anything. The conclusion we've come to is that
the connection's not being made, and the browser/server aren't getting
enough information to attempt to define the error. :(
The error I posted is the one that I get in Netscape. In IE 5.5 I
get "The page cannot be displayed..." "HTTP 500 - Internal server error
"
That help any?
Ariel Comstock wrote:
> Andy,
>
> Are you using an error object? If you use one you might be able to
get
> more accurate (and helpful) messages. Another thing to try is to
check
> to see if the "friendly HTTP messages" are turned off on your browser
in
> another attempt to get better messages. Then you can send the errors
> back here and more help can be offered.
>
> HTH to start...
>
> ariel 8:)
>
Message #9 by Andy Johnson <lysaer@d...> on Tue, 26 Sep 2000 15:54:57 -0500
|
|
WOO! Ok, cancel all this, I got the database connection to work. I had a
corrupt database on my server (Doh!), thanks to the ftp settings I was
using. Thanks guys!
Andy Johnson wrote:
> How do I put in an error object? Please be a little patient with me...I
> just started learning ASP a week ago at work, and everything's been
> running fine there...but this personal site seems to be a real
> frustration! Argh! :)
>
> I spent some time on the phone with my administrator, and he ran an asp
> code checker on the page...we've eliminated all the code inside the page
> just in an attempt to get the connection and recordset defined...and
> his checker doesn't find anything. The conclusion we've come to is that
> the connection's not being made, and the browser/server aren't getting
> enough information to attempt to define the error. :(
>
> The error I posted is the one that I get in Netscape. In IE 5.5 I
> get "The page cannot be displayed..." "HTTP 500 - Internal server error "
>
> That help any?
>
> Ariel Comstock wrote:
>
> > Andy,
> >
> > Are you using an error object? If you use one you might be able to get
> > more accurate (and helpful) messages. Another thing to try is to check
> > to see if the "friendly HTTP messages" are turned off on your browser in
> > another attempt to get better messages. Then you can send the errors
> > back here and more help can be offered.
> >
> > HTH to start...
> >
> > ariel 8:)
> >
>
Message #10 by Hal Levy <Hal.Levy@M...> on Wed, 27 Sep 2000 13:02:13 -0400
|
|
Check that the IUSER_ account has security rights to the directory where the
.mdb is stored. If the site is using strong security- it may be the
problem.
Does a connection with a DSN work?
Hal.Levy@M...
Senior Solutions Consultant
"Extending the Corporate Reach" (TM)
http://MediaServ.com
(xxx) xxx-xxxx Ext. 372
-----Original Message-----
From: Andy Johnson [mailto:lysaer@d...]
Sent: Tuesday, September 26, 2000 9:57 AM
To: ASP Databases
Subject: [asp_databases] Pesky Access connection refuses to work
Good morning, everyone.
I've got an access database that I'm trying to make a connection to, and
failing in every attempt. I've tried 7 different connection strings, all
DSN-less, and nothing seems to want to work. This is on an NT IIS
server, latest version. The database is an Access 97 mdb file, and at
present time only contains one table with 2 records (just to get the code
working).
Any suggestions?
The response I repeatedly get when I test the page making the connection
is:
An error occurred on the web-site when processing the script. Please
contact the site administrator.
I've talked with my site admin extensively, and he can't figure out what
the trouble is, but near as he can tell the connection's
not...well..connecting.
Thanks!
|
|
 |