Understand Global.asa And Conn String

I searched the forum but I am still a little confused regarding the global.asa file. I created a global.asa file and it is in the root of the virdual directory. I then created a sub to initially connect to a datase such as: Code:

View Replies


ADVERTISEMENT

Problems Using Same Conn String Twice In 1 Page...

I have a problem utilising my connection string to open more than one recordset in one ASP page.

The following code runs absolutley fine on a server running ASP 3, but falls over when run on a server running ASP 2 (the error says:

Microsoft JET Database Engine error '80004005'

Could not use ''; file already in use.

The code I am trying to run is: Code:

View Replies View Related

Global.asa String

I have a problem with my global.asa file. I want to store a string and then search the string with InStr function.

from global.asa:

Sub Session_OnStart
Session("level") = "some:text"
End Sub

code from file:
If InStr(Session("level"),"some",vbtextcompare) > 0 Then ...

This gives me an error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "no"]'

What is wrong and what should I do?

View Replies View Related

Connection String In Global.asa

I currently have my SQL Server connection string in an Application variable in the global.asa. Could that be a security risk? I have heard that with Cold Fusion, when there is a page error. the actual Connection String is written to the screen as part of the error page.

I'm quite sure that would not occur in ASP but just wanted to be sure, and get a few expert opinions.

View Replies View Related

Connection String In Global.asa

I was looking at another post, and what the person did was:

Dim strConn
strConn = "string"
application("strConn") = strConn
Now, am I able to create a connection object in my global.asa like so, and then keep my existing syntax for all my hundreds of queries?

Dim strCon
strCon = string
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open strCon
?

I'm trying to SAVE bandwidth, so I want to create my connection in global.asa instead of each time my include file 'top.asp' is executed. I can also close it easily...

PS. I believe Application_OnStart() is the best place to put it, am I correct?

View Replies View Related

Cant Understand Code

i read the code but i dont understand it

rs.open strSQL,conn,adOpenDymanic,3

whats the adOpenDymanic?and whats the number 3?why not another number?

View Replies View Related

Understand Quotes Better

As I get further and further into ASP/VBscript I realize I just don't undertstand how to properly use single/double quotes at the same time. This is really holding me back. If anyone can help me understand this better or know some good articles I would appreciate it. My current problem is adding a logo to my page from the database. What quotes are needed inside my <img> tag. Code:

<img src="/teams/logos/"'"<% response.Write rs("Logo")%>"'"> .

View Replies View Related

How Browsers (IE) Understand File Types.

1) I have the following html code on the server:

<HTML>
....
.....
<BODY>

<A HREF = http://MyServer/MyDoc.doc> Click here to see the document</A>

When I click on the link How Internet Explorer understand that it's a Word
Document and It's necessary open it with Microsoft Word ? Is The extension
to give the necessary information to Internet Explorer ?
Where does IE look for the application to use to open the file on the server
? On the local registry ?

I have tried to rename Mydoc.doc in MyDoc.pdf and I have called

http://MyServer/MyDoc.pdf and the browser has opened Acrobat Reader but the
binary format is for Microsoft Word.

Does the Browser User an Http_Header sended automatically ? (for example
HTTP_FILE_NAME....IF IT EXISTS)

2)Now I have the following link:

http://MyServer/ReturnMyDoc.asp

It returns the binary data of MyDoc.doc file. Now I want to say to the
browser that the file is called MyDoc.doc (I don't want to use Content Type
= ms-application/msword) : is there a header to say this to Internet
Explorer ?

View Replies View Related

Conn, 1,3,2

I have a some code:

Rs.Open "[TableName]", Conn, 1,3,2

RS.AddNew

RS.Fields("Account_Name").Value = request.Form("Account_Name")

my question is does conn, 1,3,2 only write to the database not making the data readable? if i change it to conn, 0,1 i get page can't be displayed. I'm using access DB, with conn 1,3,2 it inserts fine, but when i go to query it i get no records found, but i see the data in the database, anybody have any ideas?

View Replies View Related

Conn.execute

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open application("dtat_motor_connectionstring")
set rs = new adodb.recordset
'Set RS = Conn.Execute(' "exec spcn_update_transactions &
customer_number, customer_name, customer_address, customer_city,
customer_state, customer_zip, customer_phone, vin,
acct_number, tag, title_number, tag_type_number, branch_number,
institution_number, yr_make, state_from, type_number)
response.write rs

%>

I'm I connecting them correctly. Is there and easier way to execute a stored procedure. I'm trying to insert data into a SQL page. I have to have the customer number returned to me asap for the next page.

View Replies View Related

SQL Conn.execute

I use this code all the time, but what does the ",,129" mean? Are there other parameters that one might use (I only do fairly simple SQL commands).

conn.execute strSQL,,129

View Replies View Related

Conn.Execute LockType

Is there any way to modify the locktype when updating a database via a connection object's execute method? I have a game which worked completely fine when only ten or so people were playing, but as it grew into the hundreds, many people started getting errors and I'm 99% sure that they occur when the database tries to update when it's locked, which means that my connection execute statements are defaulting to pessimistic locking, which I don't want them to. Does anyone know how I can fix this?

View Replies View Related

Protect Conn.strings

what is the best way to protect the connection strings keeping an effective, low overheaded access to them ?

View Replies View Related

Troubleshooting Access Conn. In Dreamweaver

I have 3 db connections, 2 of which are dsnless connections to access db's. Any of my previous existing pages that have recordsets from these db's work fine. I can add a new recordset to them and it works fine as well.

If I create a new page and add the same recordset in the same directory, I get the error msg saying something like "unable to open registry key" which from my understanding, means the page cant find the db.

Now I am using Dreamweaver 2004, and using their way to create connections where it creates a file, and then just adds an include statement an asp page if you use that connection.

Any good way to test this connection on the page or any ideas on how to troubleshoot where the path its pointing to is incorrect...im pretty much stuck at this point.

View Replies View Related

Conn.Errors.Count Or Err.Number For Transactions?

What is the best way to control is a transaction? I've done a little test and both of the examples below seem to do the job, but I was wondering which is the better method, this:

If err.number <> 0 Then
conn.RollbackTrans
Else
conn.CommitTrans
End If

Or this:

If conn.Errors.Count <> 0 Then
conn.RollbackTrans
Else
conn.CommitTrans
End If

View Replies View Related

Correct User, Password Sequence For DSN-Less DB Conn.?

I'm trying to access an access database by including the DB's password within the connection string. I try to connect to the DB, but I get and "Incorrect Password" error. What am I doing wrong?

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"; uid=admin; pwd="pass"
conn.Open(Server.Mappath("maindb.mdb"))
set rsUpdateEntry = Server.CreateObject("ADODB.recordset")

View Replies View Related

Storing Complete Dbase Conn In Application Object

I am currently working on a small asp application. Now I would like to store the complete database connection in the application object. Note I want to store the connection NOT the connectionstring. For that purpose I wrote a small asp include which connects to the dbase and stores the connection object to the application object. However when I use this include in my pages then it doesnt work. What I am doing wrong? Here is the code:

View Replies View Related

.mdb Temp File (ldb) Not Destroyed After Closing Database Conn

I recently installed IIS lockdown, and ever since my ASP pages have been hell. One problem is that now after a user views my ASP page which reads my local Access DB, the temporary file, .ldb, stays in the folder forever!

This temp file is created when a user opens the file, so I checked out the .ldb file and it says the ADMINISTRATOR is opening the file! How can the internet user be using the ADMIN account?! This is not good news! I will share my code for my page; however I have a feeling the code isn't the problem, but a setting is. Code:

View Replies View Related

Global.asa :: Assign Diffrent Global.asa To Each Application

I have one application folder containing all ASP code files. I want host multiple sites pointing to same code. Can I do this ? If YES then how I can assign diffrent global.asa to each application...

View Replies View Related

Global.asa :: Combine Many Global.asa Files

I have added a db driven marquee to my site and need to combine the global asa's to 1 global asa file. Code: ......

View Replies View Related

OLE Error On: Set Conn=Server.CreateObject("ADODB.Connection")

Error info is as follows:

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

Technical Information (for support personnel)

Error Type:

error '8002801c'
Error accessing the OLE registry.

/iisHelp/common/500-100.asp, line 154

Is ADO a separate install? And from where?

View Replies View Related

Web Forms / HTTP File Upload / String.Split A StreamReader.ReadLine() String

I'm developing an Asp.NET system to take a CSV file uploaded via the web, parse it, and insert the values into an SQL database. My sticking point comes when I try to split() the string returned by readline() on the file.

The following code snippet works for me:
tokens = "one,two,three,four".Split(",")
for each token in tokens
response.write("<td>"+token+"</td>")
next

However, if I take the next line in the CSV, read using StreamReader.ReadLine on the PostedFile.InputStream, I receive "Object reference not set to an instance of an object." which I have narrowed down to be my string holding the line. Further investigation reveals that no other string member functions work on my line (.ToCharArray, .ToString, etc).

I suspect that StreamReader.ReadLine is not correctly returning a string, even though Response.Write(line) displays what I would expect .....

View Replies View Related

String Functions Run On Empty String

I have a form in which several elements are expected to be all digits. Some of those elements can be left empty, but if specified they must be all digits. I have this Sub to edit them: ....

View Replies View Related

Text String To A Interger String

I am pulling info from a sql server By default the query pulls back the inforamtion as text.Therefore when I go to calculate some figures its giving me a type mismatch error.
Is there a function in can call to convert a text string to an integer string using

rstSearch.Fields("name").Value .To pull back the info in a for loop

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch

View Replies View Related

Global Asa

I am trying to put a condition in my Global.asa file based on the server
name.the reason, I want to set a global string as a application variable based on
the server I am on.
I also need to set a coonection string based on the value of the server.
I need to use this connection string to retrieve values from an sp in
application on start that sets a load of global variables so I can't really
do this anywhere else.

View Replies View Related

Global Asa

I have a site which until this morning, was on a remote server. The structure was that the "site" was actually a folder on the server, as I am designer and use this arrangement to develop sites. Under the root directory, I had modified the global asa file to include session variables. Ok, so I download the site (folder) to my hard drive, and put it in the folder of "MY Documents" called MyWebs. I then opened VB Studio and created a new solution, which is pointing to the before mentioned directory in My Documents. When I pull the site up in IE, the session variables were not being called, and I realized I had not copied over the asa file. So I did so, placing a copy of it in the hard drive's c inetpub wwwroot directory, and also directly in the my docs mywebs directory,and the site's directory as well. It seems it is still not being called.Can anyone tell me what I am doing wrong?

View Replies View Related

Global.asa!

Is the Global.asa file resolved before parsing the 'Include' (files) or
after parsing the 'Include' (files)?

View Replies View Related

ASP, GLOBAL.ASA

I have IIS 5.0 installed on for a test server. the global.asa file runs perfectly.

when tryng the same application on win server 2003 IIS 6.0 the global.asa does not fire. i have set the application as a virtual site and given rights for iwam and iusr. What else could be the problem. Code:

View Replies View Related

GLOBAL.ASA And IIS 6.0

How does IIS 6.0 treat the global.asa file? I had the following problem;

1. uploaded a new site to the win3k server

2. had incorrect db connection string in Session_OnStart in global.asa and website caused errors.

3. Changed the global.asa file to include the correct details. Saved the file. Still got the same errors.

I could not resolve this unless restarting the WWW Service on this server. In IIS 5.0 the global.asa file would reload after resaving it (as the timestamp is updated).

I even waited the next day before restarting the service because I though Session_OnStart expires after my session ends...but the error was still there
in the morning.

Hopefully someone will make sense of it for me. Here is the code (I inherited) in the global.asa

Sub Application_OnStart
Application("DB.ConnectionString")= ""
Application("MaxLoginAttempts") = 5
Set Application("Con") = Server.CreateObject("ADODB.Connection")
Session("Test") = Now()
End Sub

Sub Session_OnStart....

View Replies View Related

ADO In Global.asa

Is it possible to use ADO in global.asa?I simply want to creat a log of each visit to the site?

View Replies View Related

COM And Global.asa

I created a dll to track our users and I want to call it in the Global.asa. How do I do this? I've seen the <OBJECT> tag to create an object, but I'm not sure how to use it correctly.

View Replies View Related

Global.ASA Reg.

I dont have any idea about Global.asa. Is it for global variable declarations?

View Replies View Related

How To Use Global.asa

i'm a little bit confused with using application_onstart.. as u can see in the following code... my DB connection and SQL statements is currently included in my application_onstart event.. but, unfortunately, i wasn't able to reference Application("sUser") in my asp when i tried to run my website Code:

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved