View Full Version : VERY NEW to ASP - What am I doing wrong? !

01-23-2003, 10:18 PM
HI there

I am very new to ASP.

I have read a tutorial by Jay Greenspan on ASP and creating databases etc at www.webmonkey.com.

Everything worked perfectly on my PC - using MS Access and after installing PWS.

I used the example that Jay had given, and all asp pages worked fine.

After checking that my server does indeed accomodate .asp (by using a simple write script) I uploaded the asp files and the Access database to the server.

The first page came up with JUST TEXT on it (as was supposed to be).

The next page then came up with the text followed by, where the drop down boxes were supposed to be::

ADODB.Connection.1 error '80004005'

SQLState: IM002
Native Error Code: 0
[INTERSOLV][ODBC lib] Data source name not found and no default driver specified

carsdown.inc, line 5

Could someone please tell me what this means?

Data source should be fine - I haven't changed anything.

And the no default driver specified ?????

Your help would be appreciated.

If there is anything else I need to tell you let me know - as I said.. EXTREMELY NEW to .asp

Thank you

01-24-2003, 02:18 AM
Were you usin a DSN on your server (PWS)?

If so then you will need to create a DSN on your hosted site. But the easiest way to do it is DSN-Less which doesn't require this.

DSN-Less connection example:

Set conn = Server.CreateObject("Adodb.connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=";&server.mappath("yourdb.mdb")

But if you are using something like the above already than I think that the script may be looking for the file in the right place. :confused:

I think I may need to look at your database connection code.

01-24-2003, 06:17 PM
Hi Mhtml

OK. Firstly, thank you for responding.
Secondly... What? !!!!!!!!!!!!

Please excuse my ignorance, but I do not have a clue about any of this!

OK. This is what I did. Everything workied on my PC using a PWS.

I then ftp'd the files to my host's server, including the access database.

If so then you will need to create a DSN on your hosted site

I do not know what this is!!!!

The code in the firts asp page that is not working is below:

<%@ Language = VBscript %>

<TITLE>Parking Progress Headquarters</TITLE>

<BODY bgcolor="black" text="white">
<table width="250">
<font face="arial" size="6">To help you, I need to know about your needs.
<p>Tell me, what kind of car do you drive?</font>


<table width="500">
<form action="info2.asp" method="get">
<td width="500" align="center">
<% 'Get this information from includes. %>
<p><!--#include file="carsdown.inc"--> With a <!--#include file="trandown.inc"--> transmission<br>
<p><input type="Submit" value="Let Jay Know" align="LEFT">



Now, from the above code, I can see myself quite clearly that it does not actually mention the Cars.mdb at all. So obviously, I need to point it to the Cars.mdb - but how? Is there another file that tells the script where to find the access database?

Below is the code for one of the include files:

'Request the name of cars and the primary key from the Cars table.
SQLCAR="SELECT carName, carID FROM Cars"
set conncar = server.createobject("ADODB.Connection")
conncar.open "parking"
set cars=conncar.execute(SQLCAR)

<select name="carID">
<% 'Loop through the recordset to make each entry in the list. %>
<% do while not cars.eof %>
<Option value = "<%= cars(1) %>"> <%= cars(0) %></Option>

<% conncar.close %>

OK. This script mentions Cars.mdb....... But it also calls it parking - I had to do this when I set up the ODBC on my PC - called it parking. I just left it as is for uploading.

I am very confused!

Thank you in advance...

01-25-2003, 01:04 AM
Are you using brinkster by chance? If that's the case (and this should be the case with ANY host using Access, actually), you'll need to put your Access database in the database directory (which should be located in the same space as the wwwroot directory).

It looks like the include file above leaves out the specific connection details, probably since they may differ depending on your host.

In order to access the database, you'll need to modify your script a bit, but I modified some code I found into a nice little string that maps the path to the database for you:

Dim Conn, sConnString

sConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Mid(Server.MapPath("\"), 1, InStrRev(Server.MapPath("\"),"\")-1) & "\database\YOURDATABASENAMEHERE.mdb;" & _
"Persist Security Info=False;"

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open sConnString

' do stuff

Set Conn = Nothing

Hope this helps...

P.S. The reason databases are usually stored above the root directory is so a malicious user can't download your database file by simply guessing the name of it and typing it into their address bar. Since it's stored above the domain level, it has to be accessed by a local path - either hard-coded, or using a technique like the one above.

01-25-2003, 09:44 PM
Hey Whammy

Thank you for your reply.

OK. Looks like I am not going to be able to do this job myself!!! Need some lessons on this first and haven't got time right now.

Basically after consulting with a few others, I have found that Access.mdb will not be sufficient for what I need. Apparently, I have been told that it has limited use insofar as the number of people that can access it at any one time on teh server. I have been told that Mysql is what I should be using - the database will be used by LOTS of people at any one time, and they will be adding data to it and viewing records too.

So... Can you tell me if what I am about to do next seems plausible:

I'm going to create the database tables, queries, forms reports etc in Access on my PC. Using my PWS (that I installed the other day) I should be able to create the pages (using the little asp knowledge I have) and view them and check that all works well. When I am happy with what I have got, I will then zip it all up and send it to someone with Mysql experience who will convert it for me!!!

Is this plausible?

Or am I making a whole heap of unnecessary work for myslef?

By the way - will be looking in the next few weeks for a Mysql developer if anyone is interested!

01-27-2003, 03:31 PM
Hmm... well personally I would just create a mySQL tool like PHPmyAdmin only in ASP.

So it would be like ASPmyAdmin lol :)

Basically the PHPmyAdmin tool lets you create databases and tables. You can pretty much do the basics in access but through a web interface.

If you wanted (and I got time) I could make one for you.

01-28-2003, 01:37 AM
When using Access I usually just use a simple web interface I modified which I got here (http://hotwired.lycos.com/webmonkey/02/35/stuff/query.txt).

Of course, I put password protection on it and modified the output a bit so it wasn't so easy to break the form, using Server.HTMLEncode, etc...

However, there would be no point in using this if you didn't understand the basics of SQL and databases, so I would also check out:



01-29-2003, 03:21 AM
Hi Mhtml and whammy

Thank you for your feedback. I have to leave this project for a week or two, but shall be back!

I have and will continue to check out the info you have given me and will revert as soon as I get back to it.

Thank you.