Multiple Connections On One Page?

If you are going to be making multiple calls to the same database from a single page, should you connect/close, connect/close, connect/close....or just connect once at the beginning of the page and close at the end?

View Replies


ADVERTISEMENT

Multiple Connections

I've been using ASP.NET for a couple years now and I'm trying to fall back into ASP for a new position I've acquired...and I'm having a bit of trouble remembering. I'm running to a problem where the basic logic is as follows:

Query

Do While Not rs.EOF
Query based on value in rs
Another query based on value in rs
Loop

There is no explicit connection object, they all use the same connection string however. When I limit myself to one query within the Do/Loop, I don't have any problems. However, when I add another query in there, it bombs with: Operation is not allowed when the object is open.

I'm assuming it's referring to the connection string being reused, but why would it allow one additional connection, but not two. I can't really close this connection before needing to requery. Is there anyway around this, or am I missing something entirely?

View Replies View Related

Multiple Db Connections

On my website, I want to provide 3 pieces of statistics that will require 3 queries to my SQL database. As much as I'd like these to be live, they are part of a footer that will load each time for about 10 pages on my site. I am thinking that, although they are simple queries, it may be just too much.

What do you recommend? I could open the connection, run the query and then close it, each time. Would this be a recommend plan? Or, should I create a daily task that builds a simple text file with those query results and just pull those in each time the footer is loaded? This would not be live, but I can deal with it.

View Replies View Related

Multiple SQL Db Connections

I use a global.asa file to connect to SQL Databases. how would I go about connecting to multiple SQL Databases within a global.asa file?

View Replies View Related

Setting Up Multiple DB Connections

I have a global ASA file with the following entries

application("ConnectString") = "driver=SQL Server;Server=HOLLYWOOD;uid=user2006;pwd=password2 006;database=server1"
application("ConnectString") = "driver=SQL Server;Server=HOLLYWOOD;uid=user2006;pwd=password2 006;database=server2"

What I have is two db servers that mirror eachother. What i want to do is if the first server timesout then try to connect to the second server. It there a way to set a timeout and have these switch accordingly?

View Replies View Related

Multiple MS SQL 2000 Connections

I was wondering if it was possible to have multiple server connections in one asp application. Like if one connection to the main sql server failed, it would connect to the backup sql server.

View Replies View Related

Multiple Connections To DB From One Document.

On the second connection to a DB i get an error saying:

Microsoft JET Database Engine (0x80004005)
Could not use ''; file already in use.
/Contacts/ContactDetail.asp, line 157

In the same file I open a connection before this attempt successfully.

I bet that this is a permissions problem but I have given full control to the IUSR_Machine account as well as given it to the containing folder to be safe. The DB is access.

Still getting the error. It is relevant to opening a second connection in the same file. Here is line 131 through 165 I have enlarged and italisized the second connection where the break occurs .....

View Replies View Related

Is It Possible To Establish 2 Database Connections In 1 ASP Page?

I have a question on DB Connection. My ASP requires me to create 2 DB connections to 2 different database.

2004.mdb & Information.mdb. In this 2004.mdb, I have 12 tables(tbl1,tbl2...tbl12).

And in Information.mdb, I have a table called t_information. This table houses all the names of tables from 2004.mdb.

In my ASP page, there is a drop down list. As you can guess, this drop down list retrieves the values from table t_information that resides in Information.mdb.

When I select the table that I want to display & click the submit button, I will have to create connection to this 2004.mdb that has all the tables(tbl1..tbl12) and display the selected table. Am I right? So, to achieve the displaying of the selected data, I have to create connection to both 2004.mdb & Information.mdb right? Is that possible? I mean, can I really create/establish these 2 database connections on the same ASP page?

I really need advices on this people. Do hope to see replies here. And I understand that we can TableDef in Access? Can anyone explain to me what does TableDef do? And how to go about creating it?

View Replies View Related

Multiple Query On One Page

I have created a database request page (wahooo - new to asp and it works)
and everything is great. Now I'm creating a second page and want to know if
I'm able to make two different queries on one page. I want to be able to
create one query that uses a Request.QueryString from a URL and then use one
of the returned values from that query to create another query on the same
page. I hope that make sense. Here is the database connection code:

View Replies View Related

Multiple Page Report

i was wondering how to go about making a multiple page reports. i am really clue less.

View Replies View Related

Multiple Page Survey

i'm thinking about making a muti page survey and was looking for some input on the best way to go about it. example

i want 3 questions on the first page, the user answers then hits next the next questions load and so on. what would be the best way of programming this?

View Replies View Related

Multiple Page Values

i want to submit 30 field(textbox,combo etc.) data into database.if i take all 30 fields on same asp page or form,the page will not look good, so i want to break that into 3 pages,each page will having only 10 fields.when all required fields on first page will be filled by the user then he will click on next button,so he will see next page , i.e. page no. 2,same for page 3.

if he want to come on previous page for editing some info,it should be possible.on 3rd page there is submit button,when he clicks on submit all the info will stored into table. can anyone tell me is it possible using ASP 3.0? if it is possible then tell me how to do this?

View Replies View Related

Multiple Graphics....One Page

Im basically making a site that will have a homepage with links I will add everyday to graphics and movies on my server. When you click the link it will open a new page similiar to the homepage with the graphic/movie in the middle of hte page.

I know there's an easy way to do this so i can just have it call a database or something like that. Basically I want to just have to add a link to the home page describing what it is, then and add the link to the file to the database and have the coding do everything for me. I think this is asp.

Can someone clue me in. All the sites i've built up until now have hundreds of pages all consisting of the same thing and it's such a pain to keep duplicating code. I'm not looking to get too advanced. If I don't have to use an access database, i don't want to.

View Replies View Related

Inserting Into Multiple Tables From ASP Page.

I've been building an ASP app that sits on top of a relational database (MS Access). The problem is that the data from some web forms need to be stored in different tables. Currently I am using multiple SQL Insert statements.

The problem with this approach is that it is possible that several inserts would succeed and then one would fail. This would ruin my database. Is there some way to synchronize the Insert commands or to "flush" the commands at the same time? I need the Insert statements to either all succeed or all fail.

View Replies View Related

Multiple ASP Modules Not Working On Web Page

I currently have designed a web page and inserted some ASP modules into it. But, if I insert more than one ASP module I receive an "Internal Server Error". If I delete the second ASP module the page works perfectly. So, my questions is this. Can you only insert one ASP module per web page? Where is the problem. Code:

View Replies View Related

Multiple Select Options At The Same Page

I m trying to use multiple option menu using redirect function in ASP.

I managed to do a single option but I need to use multiple options can you please advise on how to do this, so both options apear in the same page. for instance, in the code below a user should be able to select uk and also selects between the other options; population, geography from the same page. Code:

View Replies View Related

Linking Multiple Css Files To A Master Page

We have a master page set up and it is tied to its css file through the standard method in the <head> tag. What I would like to do though is from another page inheriting the master page to add another link to a css file.

That way i can have the sites global file used to make the general apperance consistent, then make the internal content more flexible without destroying the current css file.

Is this a possible task? When i went into the main master page and tried to add a <asp:contentplaceholder id="additionCSS" runat="server" /> tag to the head. When this is done visual studio alerts me saying it doesn't recognize the tag 'asp'. Is there a way around this? We are only just rewriting the site to use master pages now so I'm still figuring it out.

View Replies View Related

TRIMMING MULTIPLE KEYWORDS On Search Page!

I am trying to make a search page. Once a serach word or words is put in I need it to serach multiple product tables and output the description of any prioduct if the search word is present in the description.

However, If i put in 2 keywords like "paper sticker" I get no results. How do you search multiple keywords? Code:

View Replies View Related

Having A Problem With Creating Multiple Page Results

I am attempting to only show 10 results per page in my results page. I keep on getting the following error. Wrong number of arguments or invalid property assignment: 'MoveFirst'
Does someone know where i am going wrong? Code:

View Replies View Related

Passing Multiple Selected Items To A Forms Page- How?

I have a query on a page that displays the results of a recordset. Each row has a check box that has the table ID associated with the row of data.

I am trying to figure out how do I send every row checked to another page and have that page know the ID's that were checked so the next page can query the table for those ID's and fill out a submission form. I know the form fields I can write so it dynamically names the value based on the script, that part is easy, but trying to figure out how to have the script accept multiple ID's so it can go through each and display the results is not.

Now this is simple if I am just sending one ID to the next page, I can just use a "Post" and append a ?id=xxx to the URL and then do a request.querystring for the ID. Where I am confused is trying to send multiple ID = 's to the next page so it reads more then one ID if more then one was checked on the previous page which 99% of the time it will be.

HERE IS MY MAIN QUESTION:

What should I look up to point me in the right direction to create a classic VBScript/ASP code to parse through the ID's that were checked on the previous page and have the next page query each ID for the data?

I can pretty much figure out how if I know what I am looking to do. I was just looking for some sort of direction that I can pursue to understand how do do this task. What is it I am trying to do? IS there a term or set of terms I need to consider looking up to get examples so I can tweak and write it from there?

View Replies View Related

How Do I Reload The Page To Show New Info With Multiple Submit Buttons

i am new to asp and web designing, and was wondering how to reload a page so that a different set of images appear, depending on which submit button is pressed. Code:

View Replies View Related

Connections DSN Less

I have a problem with DSNless connections. I used the code below but doesnt works.
An error message appears in browser...

<%
conn = Server.CreateObject("ADODB.connection");
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:path odatabase.mdb";
conn.Open;
......

View Replies View Related

DNS-less Connections

I'm trying to make the following asp code work using a DNS-Less
connection on a windows 2000 server running IIS and ODBC 4.0 driver.

The Access database (odbc_exmp.mdb) was made using Access 2002. The
code works if I set up a DNS on the server under the ODBC drivers.
What I'm I doing wrong and what do I change the code to, to make it
work using DNS-Less connection? Code:

View Replies View Related

DSN Or DSNless Connections...

Right, which do you use? If your using DSNless, then STOP! It's SLOWING down your code and making it UGLY!!

Why? Lets look...

UGLY!
Which looks better
[vbs]
"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("./data/vote.mdb")
[/vbs]
or
[vbs]
"DSN=databaseStuff"
[/vbs]

Its also easier to manage and will cause less typing errors. Think about it, it makes sense!

SPEED
Everytime you run a DSNless connection inside an ASP page the connection string needs to be verified,but a DSN connection is only verified when it is created! Meaning the DSN connection is indeed faster.

View Replies View Related

DSN Less Connections Problem

I am not sure what is wrong with this code. I have tested it at home, used in on previous webpages, and with previous employers. But I am getting this error at my current employers server: Code:

View Replies View Related

Implicit Connections

i am maintaining a system that was developed using dream weaver. a lot of the asp ado code looks like this:

set sp_yellow = Server.CreateObject("ADODB.Command")
sp_yellow.ActiveConnection = MM_MHR_CONN_STR_STRING
sp_yellow.CommandText = "Sp_HPMSQ007_GetSystemConstants"
sp_yellow.CommandType = 4
sp_yellow.CommandTimeout = 0
sp_yellow.Prepared = true
sp_yellow.Parameters.Append
sp_yellow.CreateParameter("@RETURN_VALUE", 3, 4)
sp_yellow.Parameters.Append sp_yellow.CreateParameter("@P_NAME_TXT",
129, 1, 17, "MLSTN_YELLOW_DAYS")
set rst_yellow = sp_yellow.Execute

someone on another forum expressed that dreamweaver "tends to drive the programmer to creat implicit connections and their effect on performance".could someone explain this to me? a provide some better code? (we no longer are required to use dream weaver to develop code for the app).

View Replies View Related

Open To Connections

in my main page i need to retreive record set from the database as well as search for products. but the recordsets i need to retrieve are located in a different table then the products i need to search. is this possible to do ?

View Replies View Related

Active Connections

I am programming a rather large site which will hopefully attract thousands of visits per day. I have been told by other people that MS access begins to struggle once it has about 15 active connections.

Since I am currently using MsAccess to test my scripts along with IIS 5.0 or whatever it is, I guess that at some stage I am going to have to convert all my stuff so that the data is in an SQLServer Database, and that the scripts can read and write to it. could anyone tell me what the transition is like. should I consider using SQL Server from the beginning or will I just have to change a few lines on each page.

View Replies View Related

Limited Connections

I get somthing like "Max Connection limit is reached" error msg when trying to access a page. I wonder it is got to do with winxp pro sp2 patch which only limit 10 tcp connections? Running ms access as database and IIS 5.1.

View Replies View Related

Close ALL Connections

how to close all open database connections without referring to each connection by name across an entire server?

View Replies View Related

Closing Connections

What's the proper syntax for determining if a connection is open before closing it?

View Replies View Related

Port In Connections

i have a connection string (this all in asp )

tCSCst = Provider=SQLOLEDB;Data Source=test02x2;Port=1444;Initial
Catalog=<cataloge>;User ID=<id>;Password=<password>

Set testCaseServerConn = Server.CreateObject("ADODB.Connection")
testCaseServerConn.Open tCSCstr

but i get the following error

An error occured:-2147467259 - Invalid connection string attribute

the problem seems to be the port itself, if i use 1433 then it works fine.

View Replies View Related

Open DB Connections

how I might go about displaying all current open db connections in ASP, either for a particular web app/page or hopefully all of IIS ? We are having a few issues with IIS hanging and we feel that it is related to db connections that were opened and not closed. I would like to be able to write an ASP page that could show me the current amount of open db connections from IIS.

I need to do this from the IIS side not the SQL Server side. I can already see the number of sessions in SQL Server but I am more interested in trying to find asp pages which have opened a connection to some db and not cleaned up properly afterwards.

View Replies View Related







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