Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 March 14th, 2009, 05:04 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: , , .
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default Database connection

Hello,

I have a form where a user provide database connection info and than click "Test" button to check if given database info is correct or not.

If database is MS Access then user provides database name and path and if it is Sql Server than user provides sql server connection info.

Is there any command or script that check database connection info and find whether info provided by user is correct or not?


Thank you,
 
Old March 16th, 2009, 04:28 AM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Ummm...just try to make the connection and test to see if it worked or not???

Code:
Set conn = Server.CreateObject("ADODB.Connection")
On Error Resume Next
    conn.Open "...user supplied connection info goes here ... "
    If Err.Number <> 0 Then
        Response.Write "Invalid connection information"
    End If
On Error GoTo 0
...
???




Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Connection to Access Database reachsevar ASP.NET 2.0 Basics 1 November 28th, 2007 08:56 AM
Database Connection kapi.goel SQL Language 2 February 14th, 2006 07:01 PM
Database connection fogofogo Classic ASP Professional 2 December 1st, 2005 12:45 PM
Need help w/ Database connection brkd63 Dreamweaver (all versions) 1 August 5th, 2004 01:14 AM





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