Ask a Question related to ASP Database, Design and Development.
-
michaaal #1
Can I use database commands in my Global.ASA file?
Can I use database commands in my Global.ASA file like this...?
Sub Session_OnStart
Public adoCon
Dim recset
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("parts.mdb")
Set recset = Server.CreateObject("ADODB.Recordset")
End Sub
I already tried it, but I had problems. However, I read somewhere that it
could be done. Does anyone have any experience in doing this?
(My goal is to have the database opened at the start of each of my web pages
without having to type in the commands.)
Thanks!!
michaaal Guest
-
File system commands
Hi, I've been trying to work out how to issue file system commands from a PHP script to Redhat Linux. I want to be able to delete files and... -
Why do my commands keep disappearing? (file, edit, document, tools, etc.)
using windows xp, acrobat 5.05 Why do my commands keep disappearing as I do things in Acrobat. First the "file" command will disappear, then the... -
Global.asa and DSN-less database connections
OBJECTIVE: I am trying to create a connection to an access database in and then use that connection ASP pages in my application without having to... -
Problem with global.asa database and Session OnEnd
Agggghhhh.... I've read countless posting and still can't get an answer that works. I'm trying to update a record when a session ends. Here's the... -
Can I open a database connection in my GLOBAL.ASA file?
Can I use my GLOBAL.ASA file to open a database connection before each page loads? Would someone mind posting a very simple example? I tried to... -
Foo Man Chew #2
Re: Can I use database commands in my Global.ASA file?
> Public adoCon
What are you trying to do? Create a recordset object in a session variable,> Dim recset
> Set adoCon = Server.CreateObject("ADODB.Connection")
> adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
> Server.MapPath("parts.mdb")
> Set recset = Server.CreateObject("ADODB.Recordset")
or just execute a SQL command? It is not clear from your code what you are
trying to do, nor is it clear what "had problems" means...
pages> (My goal is to have the database opened at the start of each of my webNo, this is a VERY BAD idea. There are several links here that *should*> without having to type in the commands.)
convince you that opening and closing the database in each page makes more
sense (and really isn't much work having to "type in" commands; use an
#include!), if you read them with an open mind.
[url]http://www.aspfaq.com/show.asp?id=2053[/url]
Foo Man Chew Guest
-
Bob Barrows #3
Re: Can I use database commands in my Global.ASA file?
michaaal wrote:
Don't use ODBC. Use the native Jet OLEDB provider instead> Can I use database commands in my Global.ASA file like this...?
>
> Sub Session_OnStart
> Public adoCon
> Dim recset
> Set adoCon = Server.CreateObject("ADODB.Connection")
> adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
> Server.MapPath("parts.mdb")
([url]www.able-consulting.com/ado_conn.htm[/url])
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & _
Server.MapPath("parts.mdb")
What problems? how can we help if you don't tell us the error messages you> Set recset = Server.CreateObject("ADODB.Recordset")
> End Sub
>
> I already tried it, but I had problems.
received?
My guess is that you need to grant Modify permissions for the folder
containing the database to the IWAM account.
This is a bad goal to have if you want your web server to perform> However, I read somewhere
> that it could be done. Does anyone have any experience in doing this?
>
> (My goal is to have the database opened at the start of each of my
> web pages without having to type in the commands.)
>
efficiently:
[url]http://www.aspfaq.com/show.asp?id=2053[/url]
[url]http://www.aspfaq.com/show.asp?id=2424[/url]
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest
-
michaaal #4
Re: Can I use database commands in my Global.ASA file?
Just wanted to say thanks, guys. The comments you provided were very
objective and informative.
michaaal Guest



Reply With Quote

