Print Page | Close Window

Create DSN conn. (ODBC) by asp

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3097
Printed Date: 29 March 2026 at 12:01pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Create DSN conn. (ODBC) by asp
Posted By: jalochi
Subject: Create DSN conn. (ODBC) by asp
Date Posted: 28 May 2003 at 1:29pm

I would like to create remotely user DSN connections using ASP. Where could I found a ASP or CGI for it?




Replies:
Posted By: aero
Date Posted: 28 May 2003 at 4:48pm

to setup the OBDC to run DSN, do this !!!

  1. Click start -> programs -> administrative tools -> data sources (ODBC)
  2. Click on the system DSN tab then the add button
  3. Select Microsoft Access driver and click finish
  4. Enter the name of the DSN as "cds"
  5. Click on the select button and browse to your Access database
  6. Click OK and you're done


the connection to the database is like this !!!

<%

dim conn
dim rs

set conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")

conn.Open "DSN=DBNAME" (whitout .mdb JUST the name)

rs.ActiveConnection = conn
rs.Open "SELECT * FROM cds ORDER BY title ASC"

while not rs.EOF
%>

and so on !!!!

remember to CLOSE the connection again !!!!



Posted By: michael
Date Posted: 28 May 2003 at 6:47pm
he is asking to create a dsn via asp, which is not possible with a component. Evtl. WSH could do it.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: jalochi
Date Posted: 29 May 2003 at 2:18am

Yes Michael, I'm asking to create a dsn via asp or cgi or other like many webhostings.

What's WSH?



Posted By: aero
Date Posted: 29 May 2003 at 2:36am
ohhh  sorry


Posted By: jalochi
Date Posted: 29 May 2003 at 3:10am

I have found the next code:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q184/6/08.asp&NoWebContent=1 - http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q184/6/08.asp&NoWebContent=1

but is for VB. How could I use it in ASP?



Posted By: Mart
Date Posted: 29 May 2003 at 3:13am
wsh is windows script host



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net