473,394 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

MS SQL connection

Hi,

How can I make an MS SQL connection other than DSN? Thanks

Atse
Jul 19 '05 #1
4 6323
www.aspfaq.com/2126

"Atse" <du******@yahoo.com> wrote in message
news:oX*******************@news04.bloor.is.net.cab le.rogers.com...
Hi,

How can I make an MS SQL connection other than DSN? Thanks

Atse

Jul 19 '05 #2
By the way, how can I do if I don't want to write those lines on every pages
but write once somewhere and effect all pages, like making a global
connection? Can I?
Thanks again.

"Atse" <du******@yahoo.com> wrote in message
news:oX*******************@news04.bloor.is.net.cab le.rogers.com...
Hi,

How can I make an MS SQL connection other than DSN? Thanks

Atse

Jul 19 '05 #3
No, you shouldn't do that, but you could use an #include file (or
global.asa) that has the connection string defined, then wherever you need
it you just say

set conn = server.createobject("ADODB.Connection")
conn.open connectionString ' or session("connectionString")

--
Aaron Bertrand, SQL Server MVP
http://www.aspfaq.com/

Please reply in the newsgroups, but if you absolutely
must reply via e-mail, please take out the TRASH.
"Atse" <du******@yahoo.com> wrote in message
news:sg*******************@news04.bloor.is.net.cab le.rogers.com...
By the way, how can I do if I don't want to write those lines on every pages but write once somewhere and effect all pages, like making a global
connection? Can I?
Thanks again.

"Atse" <du******@yahoo.com> wrote in message
news:oX*******************@news04.bloor.is.net.cab le.rogers.com...
Hi,

How can I make an MS SQL connection other than DSN? Thanks

Atse


Jul 19 '05 #4
> You mean I can do that like below?
<%
' this is in the page global.asa
cst = "Provider=SQLOLEDB;Server=<ip address>;database=<dbname>;"
cst = cst & "network=DBMSSOCN;uid=<uid>;pwd=<pwd>"
set conn = Server.CreateObject("ADODB.Connection")
This last line should *NOT* be in global.asa
<!--#include file=global.asa>


No, you don't #include global.asa. If you just want to #include a file,
name it something else, like connection.asp ...
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: G-Fit | last post by:
Hello group, I have several servers hosting SQL databases. On each of them, I have several databases. All those databases have the same structure (even those on different servers), only the data...
11
by: pradeep_TP | last post by:
Hi all, I have a few questions that I have been wanting to ask for long. These are all related to ADO.net and specifically to conenction to database. 1) If I have opened a connection to a...
6
by: Chris Szabo | last post by:
I've created a data access layer for a .NET web application. I'm using C# and framework 1.1. I'm getting an error from time to time when I close a connection saying: ...
18
by: Rob Nicholson | last post by:
We're getting an occasional occurrence of the following error when two users try and open the same record in our ASP.NET app: "There is already an open DataReader associated with this Connection...
35
by: Eric Sabine | last post by:
In my Finally block, I was using cn.close (where cn is an ADO.NET connection object, SQLConnection to be exact) and then I came across the following in some microsoft code. If Not cn Is Nothing...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
0
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.