Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 How can I create a DSN via ASP?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

CarKnee
Junior Member

USA
297 Posts

Posted - 10 October 2003 :  10:54:40  Show Profile  Visit CarKnee's Homepage
Does anyone know the code to create a DSN via ASP, or even server side vbScript?

In particular it is a FoxPro or dBase DSN.

Thanks,
CarKnee

dayve
Forum Moderator

USA
5820 Posts

Posted - 10 October 2003 :  10:59:49  Show Profile  Visit dayve's Homepage
Create a DSN or a connection string to use a DSN? If you are looking to create an actual DSN, then all I found was this. Not sure how well it works though.


<HTML>
	<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
	<TITLE>ODBC SQL Server @softwing.com</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
<%

Set xObj = Server.CreateObject("Softwing.OdbcRegTool")
strDriver = "SQL Server"
strDSN = "DSN=New SQL Server Data Source" & vbNullChar & "Description=New SQL Server Data Source" & vbNullChar
strDSN = strDSN & "Server=(local)" & vbNullChar
strDSN = strDSN & "DATABASE=pubs" & vbNullChar & vbNullChar

retval = xObj.CreateDSN(strDriver, strDSN)
If retval = True then
	Response.Write "DSN Creation successful."
else
	Response.Write "DSN Creation failed."
%>
</BODY>
</HTML>

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 10 October 2003 :  11:01:18  Show Profile  Visit dayve's Homepage
wooops, this requires a component to be installed... (Softwing.OdbcRegTool). Sorry, not sure if it can be done.

Go to Top of Page

CarKnee
Junior Member

USA
297 Posts

Posted - 10 October 2003 :  11:05:22  Show Profile  Visit CarKnee's Homepage
Thanks for the effort dayve... I would then need to register a com by ASP

Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 10 October 2003 :  22:23:02  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Just ask your host, they should be able to setup a DSN, but might charge to create it.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 12 October 2003 :  12:17:01  Show Profile  Visit dayve's Homepage
why not use a DSN'Less connection string? Or is there more to this that we're not aware of yet?

Go to Top of Page

CarKnee
Junior Member

USA
297 Posts

Posted - 16 October 2003 :  12:30:24  Show Profile  Visit CarKnee's Homepage
Redbrad. The reason I wanted to do it programatically was to avoid the host ;)

dayve. The people that asked me to look into this were having problems using a DSN''ess conection on a FoxPro database.

This issue has passed, but thanks to everyone.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07