Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2004, 11:33 AM
Authorized User
 
Join Date: Jan 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Conn.Open "DSN=HRdbase;UID=;pwd=;"

I checked the connection and it tests successfully.

 
Old October 1st, 2004, 11:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Check if you are missing the UID and PWD values there.
I would suggest you not to use DSN connection, as that is not among the recent ways of connecting to databases and seems to be slower approach as suggested in many of the other posts. Moving out in a hurry...

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old October 1st, 2004, 11:43 AM
Authorized User
 
Join Date: Jan 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Where can I find the new ways to connect. I just finished a training class and that is how they taught us to connect. Go figure it wouldn't be the best way.

Thanks for all your help!

 
Old October 1st, 2004, 12:11 PM
Authorized User
 
Join Date: Sep 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

TEE88 there is plenty of websites out there explaining connection strings etc. as happygv says, stay away fro using DSN connections, as these really aint the standard why of connecting to data stores. I suggest using a DSN-less connection, do a search on google. Also think about purchasing Wrox ASP beg book or the database one.. U will find loads of useful information and it will also give u a good basis of how to start programming in ASP

DJWright
 
Old October 2nd, 2004, 04:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Tee,

Well, Though there are a lot of such discussions over the performance on using the connection string, I would suggest you, stick with OLEDB standard connection string, as it is the native provider.

OLEDB - commonly used standard connection string.
"Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"

Then your code would be ...
Code:
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "Provider=sqloledb;Data Source=YOUR_SERVERNAME;Initial Catalog=YOUR_DATABASENAME;User Id=YOUR_SQL_USERNAME;Password=YOUR_PASSWORD;"
Conn.Open
'Now the connection to your sql server is made to executing 
the sql statement that you construct at the later part of this code.

Replace all the entries in the connection string posted above, that are prefixed with YOUR_
with the values that apply to your sql server.
Also take a look at this article, that would shed some light on Connection string.

DSN, DSN-Less or OLEDB?

What's in an ADO Connection String?

Miscellaneous tips for improving ASP performance and robustness

Quote from another site.
Quote:
quote:Why to use DSN Connections ?
* Provides easy to remember data source names.
* When there are lots of data sources to think of and you want a central repository to hold the collection
of data sources without having to worry about the actual site and configuration of the data sources.

Why to use DSN less Connections ?
* When you can't register DSNs yourself e.g. when you are running a virtual hosting account on other's server.
Stop emailing system administrator for Creating/Editing DSNs on the hosting server, but can connect to your databases directly.
* Provides faster database access because it uses native OLE DB providers, while DSN connections make use of ODBC drivers.
Hope this helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to SQL 2000 Belisarius C# 0 February 17th, 2006 04:07 PM
connecting to sql 2000 using visual c# 2005 ejedspence C# 2005 0 June 17th, 2005 03:01 PM
I need help connecting to SQL Server 2000 aehb C# 6 April 27th, 2005 03:00 PM
Issues Connecting to an Access 2000 Database... Jonny ADO.NET 1 February 11th, 2004 09:54 AM
Connecting to an Access 2000 database Jonny .NET Web Services 0 November 10th, 2003 03:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.