Open Database Connection When Users Visits?

Basically everytime I need a page to access a database I will create a connection object, and then at the end of the page I will close the connection object.

Would it be more sensible to create all the connections to the database that a user will need when they first visit the site, and then close these connections once they leave the site. (Using something to do with Start Session and End Session).

View Replies


ADVERTISEMENT

Open Connection

I was working on a site an I forgot to open up a connection to my database, but it connected anyway.For example here is the code to create the recordset I am using

connb4b = "DSN=b4b2005" 'i left out the uid and pwd of course for obvious security reasons

set myRecordSet = Server.CreateObject("ADODB.Recordset")
mySQL = "SELECT * FROM inn WHERE inn_code = '" & myInnCode & "'"
myRecordSet.Open mySQL, connB4B, 2, 3

Anyway, the above code created the recordset fine. Do you not have to open a connection to the database, but just pass it the connection string in the open command of the recordset?

View Replies View Related

Server Can't Open Connection

I have a site on 1and1. The site has a simple login as well as other asp applications. This site uses an access DB. Last week all the scripts that accessed any database resulted in this error: Code:

View Replies View Related

Open Connection To Another Server

I would like to connect to another server and execute my query from my asp page. But how can I initiate the connection string to another server DB? For example Code:

ConnString = "dsn=abc;uid=xyz;pwd=123"

What will be the way to issue the connection string to another server? Using SQL Server 2000.

View Replies View Related

Can I Keep A Connection Open To Wait For Output From A Proccess

I have a web form that uploads a file to the server where the file is proccessed and outputs a report, the time lapse between uploading the file and the report being produced varys from a few seconds to a few minutes depending on the number of clients requesting reports.

My question is after the file has been uploaded is it possible to keep the connection open and inform the client when the report is ready for downloading.

View Replies View Related

Counting Visits

I would like to how to count the number of visits a person makes to a particular asp page. Let me give an example. Suppose a person is participating in an e-discussion.

we would like to know the number of questions he has answered, the number of questions he has just seen but not answered and the number of questions not at all seen by him.

View Replies View Related

Bots Accontable For My Page Visits?

i have implemented the below code into all of my pages within my website. my impression was that when a physical human being reaches each page the code will enter an increase of 1 into my database for that particular page. i have noticed the hits have been way high but i dont believe that a human is generating these hits.

Are bots and other programs on the net able to generate hits into my database according to my code? Code:

View Replies View Related

Adding Users To A Database

I am trying to run a script that will add users to a database so they can register with the site. ive got it working so that the users are added however i am trying to prevent people from registering the same username or email address and this is not working.
the script firstly checks that the user has filled out all the fields in the form from the previous page then the script is supposed to check the database for the username and email then adds the user if it is all ok however if the fields have all been filled out it simply adds the users anyway. here is one of the check scripts i am using VBscript and an access database .....

View Replies View Related

Many Users On Access Database

I am using an application I have put together which unfortunately uses an Access database. I say unfortunately, as I have got a lot of users hitting the db at the same time - inserting and updating... plus retrieving information.

Is there a way I can safeguard inserts and updates or at least have more friendly error pages so that the user can retry to send their data... ? I don't want pages to simply fall over because there are too many users.if this is possible. Even if there is a delay or some other technique I can employ, so that inserts can be queued?

View Replies View Related

Multiple Users Accessing Database

When more than one user tries to access my system, one user gets his page processed, and the other users recieve an error message stating:

Microsoft JET Database Engine error '80004005'

Could not use ''; file already in use.

/processweb/html/cpr/admin/sel_sc.asp, line 25

I am using ASP 2, MS Access 97 and IIS 4. Any ideas why only one user is allowed to access the database simultaneously? The database file itself is closed.

I have a hunch it may be because the IUSR_[machine name] user account on the web server does not have access to the *.ldb database locking information file... Does this sound like a plausible reason?

View Replies View Related

Creating Unique Usernames For Users Of A Database

I am tryin to create a database of users for my system,each user is given a username based on their own name(surname and first name), however if 2 users with the same or similar name enter their details they will be given the same username,for example john drew would return drewj as thier username, so would jack drew, when a new user is entering their details how do i check that the username generated for them does not already exist,i.e i need to compare the username generated for the new user with all usernames already held in the database,if the username does already exist i want to add a digit to the end of the username how is this done using asp?

View Replies View Related

Database Connection String To MySQL-database On A Different Server

I work with ASP for several weeks now and i really like it! But until now i have just used it in connection with my localhost. I made connections to a SQL Database and to an ACESS Database with using the ODBC Tool from WIndows!!


Now i want to publish my website but i don't know how to handle the connection string kind of thing. My MySQL-Database is on a different server than the website and i need a connection string where i can type in the server, a password and a username and it should then connect.

View Replies View Related

Open A Database

I want to Open a database with asp, I know the syntax to do with VB but how do I make the refference of the DAO in ASP?

View Replies View Related

Open Database Value In Word

I'm using ASP to pull info from a database and open it in Word. Everything works fine but I want to specify the paper size to be Legal. Is this possible or am I stuck with Letter size?

View Replies View Related

SQL Statemet To Open Database

this should be an easy one. I have a script which I use to add a new record to a database. Simple enough. But I have always used this string in opening up a database for just such a purpose:
"SELECT * from images"
Ok, I obviously don't want to select all every time I want to add record, so how would I just get access to that table without opening all of the records? Would it be -
"SELECT images

View Replies View Related

How Can I Open The Excel Database In ASP?

I have a databse in MS Excel which I would like to use it in ASP? I know in MS Acces the provider parameter is as follow:

Provider=Microsoft.Jet.OLEDB.4.0

What is the equivalent of this provider to open Excel file? Or is there any other way that I should do, inorder to open the Excel files?

View Replies View Related

Codes To Open An Access Database?

my database is database.mdb
my file path is C:Inetpubwwwrootfypdatabase.mdb

Error Type:
Microsoft VBScript runtime (0x800A0009)
Subscript out of range: ''

Besides using this ASP code of opening up my database is here any other way??? I often get the above error due to " This is my present code..

<%

dim objConn, path
set objConn = server.createobject("ADODB.connection")

path = "C:Inetpubwwwrootfypdatabase.mdb"
objConn.open "driver={Microsoft Access Driver (*.mdb)};dbq="& path &";"

%>

View Replies View Related

Problem With Open Database Function

I try to use as much functions as possible. So I have written a function to open a database and retreave the information from a specified field but it don't want to work.
This is the function I use Code:

View Replies View Related

Open/read A Text Database

I have a database that was originally in Excel. After modifying it, I have saved it with .txt and another one with .csv format. DB.txt (Text (Tabl delimited)(*.txt)
DB.csv (Text Comma Separated Value) (*.csv). What is the command/statement in oppening database record for these formats?

View Replies View Related

Open A Database Connect From One Server To Another

I have two servers is it possible to open a database connect on one server to access the database on the other. If so can anyone give me an example of the path.

View Replies View Related

Open Forms In Access Database

how to open or do a connection to open switchboard in the Acccess database? Really Really need help from you who knows the code to open the switchboard in access database using asp. or Is there a way to link switchboard form to the asp page so that when i click on a link , it will open up the switchboard form (lets say the form's name is called "Contact") from the Access Database ?

View Replies View Related

Logging Users :: Transactions My Users Perform

I want to be able to log in a database any transactions my users perform. For example logging in, requesting a page, downloading a resource, logging out etc.

What is the most practical way to code this? I was thinking of trying to use an include file which would have a function to add a log in the database for each page on the site or when a particular action is performed.

View Replies View Related

Use Asp To Open An Excel File And Upload To The Database

I want to provide a function using asp for the users to search for their excel files in their PCs in IE and then upload to my database.

View Replies View Related

Open Word Document Stored In Access Database

anyone know how to open in ASP a word .doc stored in an access database.

View Replies View Related

Basic Code To Open, Select And Close A MySQL Database

I am looking for the basic code to open, select and close a mySQL database using asp code. I am experienced in php and have a site using php to access this database but this client would like one page using asp.

View Replies View Related

Database Connection

I am familiar with connecting asp pages to sql server when both servers are
on a LAN.

Can anyone advise on how to connect when the servers are remote from each
other?

View Replies View Related

Database Connection

I was wondering if i can create an if/else statement that checks if my connection string that opens a database ie:

cnnDB.Open Application.Contents.Item("CONNECTION_STRING" )

(the actuall connection string is in my global.asa file incase u were wondering) ...or if the database can't be found or opened, will run some other code... like a message?

hope u get what i mean.

this is just incase a user has the DB opened, or is in the process of overiting the DB or something, the page would not display that Microsoft JET Database Engineerror but display a message i set up in the if/else statement.

View Replies View Related

Database Connection

I have created a database called "myshop.mdb" Then I create a System DSN connected to that database called "OE1" The following code retrieves attributes and possible errors from the DSN Code:

View Replies View Related

Database Connection.

I have been trying to get an intranet search page to work that looks at an Access database. The database is called database.mdb, and lives in the root of the site, as does the .asp (security is not a problem at the moment). The code was taken from an asp website. I am running .net and Windows server 2000.
Could someone look at the code and tell me if it looks OK for connecting to the database? Then at least I can rule out code as the problem I am having.(receiving error codes)

View Replies View Related

Database Connection

I am getting this error at all my ASP pages. A sample page which pulls the categories from the Northwind database is enclosed below where I get the error when I am trying to open a recordset with that SQL query and Connection. Code:

View Replies View Related

Database Connection Over LAN

I would be glad of some help being new to ASP.
I manage my department information through an Access relational database and an http network model database. Naturally enough I want to combine them.
We have an old NT driven LAN with pc's running Win 9x or XP pro. The file server is nearly up to capacity on storage and bandwidth, the new XP machines have plenty. The network is backed up daily. If possible I want to use the XP m/c as a web server.
I want to use IIS and ASP from an XP m/c to read and write to databases on the file server but can't seem to get the connection string right, I have tried many, with and without DSN's. Having checked up on IIS (installed on XP pro) I suspect that it can only connect locally. Certainly everything runs on a test setup in C:/inetpub/wwwroot which can be accessed across the LAN and ASP runs fine.

View Replies View Related

Database Connection

i want to open a connection for password protected database but i don't want to write password in code as it can be seen by my host provider and misused is there any way I can read database password without writing it in my code.

Set cN = Server.CreateObject ("ADODB.Connection")
cN.Open "DRIVER={Microsoft Access Driver (*.mdb)}; password=joy; DBQ=" & Server.MapPath("db1.mdb")

above example works fine but i dont want to write password in my code is there any way i can do it.

View Replies View Related

Database Connection

How do i detect whether the database connection is open or not in a asp page?

View Replies View Related







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