Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

not finding database???

Status
Not open for further replies.

bjm027

MIS
Mar 7, 2003
59
US
New with asp, but learning and this forum has been a great help.
I am making a simple sign up form in asp. I am getting an error:
"Data source name not found and no default driver specified"
I have the database set up with the appropriate tables and fields and in the same directory as the website. The database is under a folder 'fpdb' in the directory. Why is it not finding the database? Isnt that what the error means?

I have other pages set up this way and it works. Did I forget something???
---------------------
Dim Conn
Dim strSQL
SET Conn = server.createobject("ADODB.Connection")
Conn.Open "Database"

strSQL = "INSERT INTO SignUp(Name, Email, School, Major, Event, Organization) VALUES ('"+ Change(Request.Form("Name")) +"', '"+ Change(Request.Form("Email")) +"', '"+ Change(Request.Form("School")) +"', '"+ Request.Form("Major") +"', '"+ Request.Form("Event") +"', '"+ Change(Request.Form("Organization")) +"')"

Conn.Execute(strSQL)

Conn.close
set Conn = nothing
-------------------------

Any help appreciated.

Thanks in advance.
 
You need to setup a Data Source Name "DataSourceNameIsHere" on the server, connected to your database to make it work, like this:

Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "Data Source = DataSourceNameIsHere;"
strConnection = strConnection & "UID=sa;PWD=;"
objConn.Open strConnection

Do you have administrator access to the server?

There is a way to connect to a database directly by filename, but I need to find my notes... Let me see...
 
Unless the word "Database" is the name of a DSN, then yes you have a problem. The system doesn't know a) what kind of database it should be trying to make a connection to, and b) where that database is located

In this case I am assuming your using an Access db since you said it is file based. You will need to specify both a pth for that database an the driver to use in order to communicate with the database. Generally it should look something like this:
Code:
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("myDatabase.mdb") & ";"

basically this says use the OLEDB Jet 4 driver (OLEDB MS ACCESS Driver) to connect to a database at the following location.

-Tarwn

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
Perhaps this will help:

faq333-178

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
--Douglas Adams
 
It would appear that I am getting slow in my old age... I could (but I won't) swear there weren't any responses when I opened it... [ponder]

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
--Douglas Adams
 
Same here :)

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
Tarwn writes ==> "Same here :)"
cause he's sooooooo..... old

[hammer] you've got one leg in the grave...ya, right mr.OLD


[swords]

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811

onpnt2.gif
 
Thanks for all of the response...
I dont think I will have too much time today to play around with this today. But I will post when I try out the help you provided me with.
Yes, I am using Access also.

It doesnt seem to want to open it but I probably have to point it in the right direction...

Ill keep you posted

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top