Ask a Question related to ASP Database, Design and Development.
-
Quintus Snapper #1
Problem getting connction to Access DB using ASP
I have a website running on a Win2000 Machine (IIS), and it's
programmed in ASP and uses an Access 2000 DB.
The site generally runs fine. However I used to have a problem that
occasionally the website could no longer get a connection to the DB. I
had noticed that this always happened after I had downloaded the DB
made some changes to the DB structure and uploaded it again. The ASP
code would always fail at connection BD connection line. The only
solution I found to resolve the problem would be to restart the
server! I tried switching to a DSN Less connection (used to use
ODBC... see my connection string below) but that also didn't prevent
it from happening.
After having given up on trying to find out how not prevent this from
happening after uploading, I ended up figured out how to make all
changes to the DB with SQL commands which although a bit more
cumbersome (for me anyway!), did allow me to make the changes and have
the added benefit of not having to take the site offline for a couple
of mins so I could live with that.
However... to my surprise I now have the same problem AND I have't
made any change the the DB myself! This is very annoying (especially
like now if it happens during the weekend and I have no service at the
hosting provider till mon!).
Has anyone else had this experience? What is the cause? Is there a way
to prevent this from happening? Or at least a way to set it right
again without having to restart the server? Since the problem appears
NOT to be with the Database (if I download it locally it works fine),
it would lead me to belive it has something to do with the Access
driver. I had tried to use the OLEDB driver, but several of my queries
did not work or gave different results to the Access Driver.
Hoping there is an "easy" fix!
Thanks for any help in advance,
Quintus
---
<%
'response.Redirect("../default_temp.asp")
'response.end
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
'ConnStr = "DSN=toucanart"
dbpath = "d:/http/toucanart.net/Databases/project21.mdb"
'ConnStr="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
'ConnStr=ConnStr & dbpath & ";"
'ConnStr=ConnStr & "Password=whatever;"
ConnStr2="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
ConnStr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
conn.open ConnStr
'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
'---- LockTypeEnum Values ----
Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4
'---- CursorLocationEnum Values ----
Const adUseServer = 2
Const adUseClient = 3
%>
Quintus Snapper Guest
-
MS Access Problem
I am trying to link my asp pages in dreamweaver into MS access - can create a registration page and login page OK, but then get into problem when... -
contribute problem - access denied file may not existpermission problem
Recieving the following error message - "access denied file may not exist , or there could be a permission problem" this happened this morning ,... -
Access problem
Hi, I am trying to upload something into a directory on my server but always i am getting a permission denied ONLY from this server...i have tried... -
Uploading problem = weird warning (was: access denied problem.....)
Hi, I had a problem where my upload form was not working on our production server but was working on two other servers, after checking the... -
Conversion problem from Access 97 to Access 2002
I have an old access 97 database and I tried to convert to Access 2002. After the conversion, some of the forms and all modules are not converted... -
Bob Barrows #2
Re: Problem getting connction to Access DB using ASP
You need to tell us the error message. You should avoid using ODBC, as the
Jet OLEDB provider will have the most features and provide the most robust
connection. I know your experience argues against the latter, but without
the error message, it's pretty hard for us to troubleshoot ...
I do recall that compacting a database will sometimes cause permissions
problems (IUSR no longer has permissions for the compacted database), so
that's the first thing I would investigate. Instead of restarting the
server, explicitly grant Change permissions on the newly uploaded database
to the IUSR account.
Bob Barrows
Quintus Snapper wrote:> I have a website running on a Win2000 Machine (IIS), and it's
> programmed in ASP and uses an Access 2000 DB.
>
> The site generally runs fine. However I used to have a problem that
> occasionally the website could no longer get a connection to the DB. I
> had noticed that this always happened after I had downloaded the DB
> made some changes to the DB structure and uploaded it again. The ASP
> code would always fail at connection BD connection line. The only
> solution I found to resolve the problem would be to restart the
> server! I tried switching to a DSN Less connection (used to use
> ODBC... see my connection string below) but that also didn't prevent
> it from happening.
>
> After having given up on trying to find out how not prevent this from
> happening after uploading, I ended up figured out how to make all
> changes to the DB with SQL commands which although a bit more
> cumbersome (for me anyway!), did allow me to make the changes and have
> the added benefit of not having to take the site offline for a couple
> of mins so I could live with that.
>
> However... to my surprise I now have the same problem AND I have't
> made any change the the DB myself! This is very annoying (especially
> like now if it happens during the weekend and I have no service at the
> hosting provider till mon!).
>
> Has anyone else had this experience? What is the cause? Is there a way
> to prevent this from happening? Or at least a way to set it right
> again without having to restart the server? Since the problem appears
> NOT to be with the Database (if I download it locally it works fine),
> it would lead me to belive it has something to do with the Access
> driver. I had tried to use the OLEDB driver, but several of my queries
> did not work or gave different results to the Access Driver.
>
> Hoping there is an "easy" fix!
>
> Thanks for any help in advance,
>
>
> Quintus
>
> ---
> <%
>
> 'response.Redirect("../default_temp.asp")
> 'response.end
>
> Dim conn
> Set conn = Server.CreateObject("ADODB.Connection")
> 'ConnStr = "DSN=toucanart"
>
> dbpath = "d:/http/toucanart.net/Databases/project21.mdb"
>
> 'ConnStr="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
> 'ConnStr=ConnStr & dbpath & ";"
>
> 'ConnStr=ConnStr & "Password=whatever;"
>
>
> ConnStr2="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
>
> ConnStr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
>
> conn.open ConnStr
>
> '---- CursorTypeEnum Values ----
> Const adOpenForwardOnly = 0
> Const adOpenKeyset = 1
> Const adOpenDynamic = 2
> Const adOpenStatic = 3
>
> '---- LockTypeEnum Values ----
> Const adLockReadOnly = 1
> Const adLockPessimistic = 2
> Const adLockOptimistic = 3
> Const adLockBatchOptimistic = 4
>
> '---- CursorLocationEnum Values ----
> Const adUseServer = 2
> Const adUseClient = 3
> %>
Bob Barrows Guest
-
Quintus Snapper #3
Re: Problem getting connction to Access DB using ASP
My server does not give very detailed error message. Since it's hosted
in DE, I get some German error message, it always gives an error
message on the line htat contains "conn.open ConnStr".
Do you know what exactly the difference it between the Access Driver
and the Jet OLEDB one?
Obviously one thing it does interpret the SQL statements differently
as when I tried it, although most of the website worked, certain parts
were giving different results! If I knew a bit more about what was
different make it easier to update the site as now there are so many
queries all over the place will take ages to find and check all of
them.
BTW, I finally managed to get it working again without restarting the
server, but removing the line "ConnStr="DRIVER={Microsoft Access
Driver (*.mdb)};DBQ=" & dbpath", trying to access the site (naturally
didn't work) and then adding it again!
Quintus
"Bob Barrows" <reb_01501@yahoo.com> wrote in message news:<O7PWs60XDHA.2516@TK2MSFTNGP09.phx.gbl>...> You need to tell us the error message. You should avoid using ODBC, as the
> Jet OLEDB provider will have the most features and provide the most robust
> connection. I know your experience argues against the latter, but without
> the error message, it's pretty hard for us to troubleshoot ...
>
> I do recall that compacting a database will sometimes cause permissions
> problems (IUSR no longer has permissions for the compacted database), so
> that's the first thing I would investigate. Instead of restarting the
> server, explicitly grant Change permissions on the newly uploaded database
> to the IUSR account.
>
> Bob Barrows
>
> Quintus Snapper wrote:> > I have a website running on a Win2000 Machine (IIS), and it's
> > programmed in ASP and uses an Access 2000 DB.
> >
> > The site generally runs fine. However I used to have a problem that
> > occasionally the website could no longer get a connection to the DB. I
> > had noticed that this always happened after I had downloaded the DB
> > made some changes to the DB structure and uploaded it again. The ASP
> > code would always fail at connection BD connection line. The only
> > solution I found to resolve the problem would be to restart the
> > server! I tried switching to a DSN Less connection (used to use
> > ODBC... see my connection string below) but that also didn't prevent
> > it from happening.
> >
> > After having given up on trying to find out how not prevent this from
> > happening after uploading, I ended up figured out how to make all
> > changes to the DB with SQL commands which although a bit more
> > cumbersome (for me anyway!), did allow me to make the changes and have
> > the added benefit of not having to take the site offline for a couple
> > of mins so I could live with that.
> >
> > However... to my surprise I now have the same problem AND I have't
> > made any change the the DB myself! This is very annoying (especially
> > like now if it happens during the weekend and I have no service at the
> > hosting provider till mon!).
> >
> > Has anyone else had this experience? What is the cause? Is there a way
> > to prevent this from happening? Or at least a way to set it right
> > again without having to restart the server? Since the problem appears
> > NOT to be with the Database (if I download it locally it works fine),
> > it would lead me to belive it has something to do with the Access
> > driver. I had tried to use the OLEDB driver, but several of my queries
> > did not work or gave different results to the Access Driver.
> >
> > Hoping there is an "easy" fix!
> >
> > Thanks for any help in advance,
> >
> >
> > Quintus
> >
> > ---
> > <%
> >
> > 'response.Redirect("../default_temp.asp")
> > 'response.end
> >
> > Dim conn
> > Set conn = Server.CreateObject("ADODB.Connection")
> > 'ConnStr = "DSN=toucanart"
> >
> > dbpath = "d:/http/toucanart.net/Databases/project21.mdb"
> >
> > 'ConnStr="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
> > 'ConnStr=ConnStr & dbpath & ";"
> >
> > 'ConnStr=ConnStr & "Password=whatever;"
> >
> >
> > ConnStr2="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
> >
> > ConnStr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
> >
> > conn.open ConnStr
> >
> > '---- CursorTypeEnum Values ----
> > Const adOpenForwardOnly = 0
> > Const adOpenKeyset = 1
> > Const adOpenDynamic = 2
> > Const adOpenStatic = 3
> >
> > '---- LockTypeEnum Values ----
> > Const adLockReadOnly = 1
> > Const adLockPessimistic = 2
> > Const adLockOptimistic = 3
> > Const adLockBatchOptimistic = 4
> >
> > '---- CursorLocationEnum Values ----
> > Const adUseServer = 2
> > Const adUseClient = 3
> > %>Quintus Snapper Guest
-
Bob Barrows #4
Re: Problem getting connction to Access DB using ASP
Quintus Snapper wrote:
Do you get an error number?> My server does not give very detailed error message. Since it's hosted
> in DE, I get some German error message, it always gives an error
> message on the line htat contains "conn.open ConnStr".
The difference is one uses the older ODBC technology, which is being phased>
> Do you know what exactly the difference it between the Access Driver
> and the Jet OLEDB one?
out, and the other uses the newer OLEDB technology.
Example, please?> Obviously one thing it does interpret the SQL statements differently
> as when I tried it, although most of the website worked, certain parts
> were giving different results!
I don't understand this sequence of events.> If I knew a bit more about what was
> different make it easier to update the site as now there are so many
> queries all over the place will take ages to find and check all of
> them.
>
> BTW, I finally managed to get it working again without restarting the
> server, but removing the line "ConnStr="DRIVER={Microsoft Access
> Driver (*.mdb)};DBQ=" & dbpath", trying to access the site (naturally
> didn't work) and then adding it again!
>
Bob
Bob Barrows Guest
-
Wes #5
Re: Problem getting connction to Access DB using ASP
I have had a similar problem with my web server. The ASP works fine,
everything is great, and then once in a while, when I log into the server,
I'll have the MS script debugger waiting for me to skip the debugging.
There is no problem with the script, its flawless and works on other
machines connecting to DB's just fine without these issues.
"Quintus Snapper" <qsnapper@terra.es> wrote in message
news:29c2044a.0308100503.2719b86@posting.google.co m...> I have a website running on a Win2000 Machine (IIS), and it's
> programmed in ASP and uses an Access 2000 DB.
>
> The site generally runs fine. However I used to have a problem that
> occasionally the website could no longer get a connection to the DB. I
> had noticed that this always happened after I had downloaded the DB
> made some changes to the DB structure and uploaded it again. The ASP
> code would always fail at connection BD connection line. The only
> solution I found to resolve the problem would be to restart the
> server! I tried switching to a DSN Less connection (used to use
> ODBC... see my connection string below) but that also didn't prevent
> it from happening.
>
> After having given up on trying to find out how not prevent this from
> happening after uploading, I ended up figured out how to make all
> changes to the DB with SQL commands which although a bit more
> cumbersome (for me anyway!), did allow me to make the changes and have
> the added benefit of not having to take the site offline for a couple
> of mins so I could live with that.
>
> However... to my surprise I now have the same problem AND I have't
> made any change the the DB myself! This is very annoying (especially
> like now if it happens during the weekend and I have no service at the
> hosting provider till mon!).
>
> Has anyone else had this experience? What is the cause? Is there a way
> to prevent this from happening? Or at least a way to set it right
> again without having to restart the server? Since the problem appears
> NOT to be with the Database (if I download it locally it works fine),
> it would lead me to belive it has something to do with the Access
> driver. I had tried to use the OLEDB driver, but several of my queries
> did not work or gave different results to the Access Driver.
>
> Hoping there is an "easy" fix!
>
> Thanks for any help in advance,
>
>
> Quintus
>
> ---
> <%
>
> 'response.Redirect("../default_temp.asp")
> 'response.end
>
> Dim conn
> Set conn = Server.CreateObject("ADODB.Connection")
> 'ConnStr = "DSN=toucanart"
>
> dbpath = "d:/http/toucanart.net/Databases/project21.mdb"
>
> 'ConnStr="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
> 'ConnStr=ConnStr & dbpath & ";"
>
> 'ConnStr=ConnStr & "Password=whatever;"
>
>
> ConnStr2="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
>
> ConnStr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
>
> conn.open ConnStr
>
> '---- CursorTypeEnum Values ----
> Const adOpenForwardOnly = 0
> Const adOpenKeyset = 1
> Const adOpenDynamic = 2
> Const adOpenStatic = 3
>
> '---- LockTypeEnum Values ----
> Const adLockReadOnly = 1
> Const adLockPessimistic = 2
> Const adLockOptimistic = 3
> Const adLockBatchOptimistic = 4
>
> '---- CursorLocationEnum Values ----
> Const adUseServer = 2
> Const adUseClient = 3
> %>
Wes Guest



Reply With Quote

