?
Solved

What is the DSN adress?

Posted on 2003-02-28
6
Medium Priority
?
414 Views
Last Modified: 2012-06-27
I just got a free database account at http://www.freesql.org and want to access it from an asp page at another server. At their connection examles page http://www.freesql.org/connection.html they say how to connect using ASP/VB. What I don't get is what to write in MY asp page to connect to my database. What shall I write for a dsn for example???
0
Comment
Question by:kalleanka
  • 2
4 Comments
 
LVL 1

Expert Comment

by:KC_Speedball
ID: 8045854
try this. it may help you

http://www.devarticles.com/art/1/50/3
0
 
LVL 8

Expert Comment

by:heskyttberg
ID: 8047516
Hi!

You get a username/password database name from them.

Let's say you got the following values:
Username: donald
Passwd: duck
DB name: dc

Then ASP code should look like this:
using ASP/VB
Dim conn
set conn= server.createobject("adodb.connection")
conn.open("dsn=mysqlDSN;uid=donald;pwd=duck;database=dc)

Now just create a select statement and so on.

Hope you understand a bit more now.

Regards
/Hans - Erik Skyttberg
0
 
LVL 1

Author Comment

by:kalleanka
ID: 8048669
My problem is still that I don't know what to write for a dsn. I got this space I use to try out asp but I don't "rule" it. I wonder if it is possible to just write the right code in my asp pages to connect to this database, couse some people have saig that I have to define it in Control Panel -> Administrative Tools -> Data Sources (ODBC), but on my PC I don't have any internal server....

I feel like a sorry piece of ****. Is this unsolvable? Can't I just write a little piece of code in my asp page and make the connection? Should it be so damn hard?
0
 
LVL 8

Accepted Solution

by:
heskyttberg earned 800 total points
ID: 8049308
Hi!

Of course you can do that!

You still need to download the MySQL ODBC drivers from www.mysql.com in order to be able to connect at all.

Here is a simple code to make a connection:
<%
Dim conn, strSQL
Set conn = createobject("ADODB.Connection")

conn.open = "DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=hostnameofmysqlserver;"_
& "DATABASE=DBNameToConnectTo;"_
& "UID=UserName;PWD=Password; OPTION=35;"


strSQL = "SELECT * FROM someTable"

Set rs = conn.Execute(strSQL)
%>


This would work without creating a DSN in control panel.

Hope this helps!

Regards
/Hans - Erik Skyttberg

 
 
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question