?
Solved

What is the DSN adress?

Posted on 2003-02-28
6
Medium Priority
?
408 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 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

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

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

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Creating and Managing Databases with phpMyAdmin in cPanel.
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 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