Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    ivy
    ivy is offline
    Regular Coder
    Join Date
    Jun 2002
    Location
    London / Glasgow / Liverpool
    Posts
    177
    Thanks
    1
    Thanked 0 Times in 0 Posts

    VERY NEW to ASP - What am I doing wrong? !

    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
    See ya

    Ivy.

    MAC Codes

  • #2
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    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:
    Code:
    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.

    I think I may need to look at your database connection code.
    Omnis mico antequam dominus Spookster!

  • #3
    ivy
    ivy is offline
    Regular Coder
    Join Date
    Jun 2002
    Location
    London / Glasgow / Liverpool
    Posts
    177
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <%@ Language = VBscript %>
    
    
    
    <HTML>
    <HEAD>
    	<TITLE>Parking Progress Headquarters</TITLE>
    </HEAD>
    
    
    <BODY bgcolor="black" text="white">
    <br><br><br><br><br>
    <center>
    <table width="250">
    <tr>
    <td>
    <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>
    </td>
    </tr>
    </table>
    
    <p>
    <p>
    
    <table width="500">
    	<form action="info2.asp" method="get">
    		<tr>
    			<td width="500" align="center">
    				<% 'Get this information from includes. %>
    				<p><!--#include file="carsdown.inc"--> With a <!--#include file="trandown.inc"--> transmission<br>
    				<br><br><br>
    				<p><input type="Submit" value="Let Jay Know" align="LEFT">	
    			</td>
    		</tr>
    	</form>
    </table>
    
    
    
    
    
    
    </center>
    
    
    </BODY>
    </HTML>
    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:

    Code:
    <%
    '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>
    	<%cars.movenext 
    	loop%>
    </select>
    
    <% 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...
    Last edited by ivy; 01-24-2003 at 05:22 PM.
    See ya

    Ivy.

    MAC Codes

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:

    Code:
    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
    
    Conn.Close
    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.
    Last edited by whammy; 01-25-2003 at 12:07 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #5
    ivy
    ivy is offline
    Regular Coder
    Join Date
    Jun 2002
    Location
    London / Glasgow / Liverpool
    Posts
    177
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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!
    See ya

    Ivy.

    MAC Codes

  • #6
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.
    Omnis mico antequam dominus Spookster!

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When using Access I usually just use a simple web interface I modified which I got here.

    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:

    http://hotwired.lycos.com/webmonkey/...tml?tw=backend

    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #8
    ivy
    ivy is offline
    Regular Coder
    Join Date
    Jun 2002
    Location
    London / Glasgow / Liverpool
    Posts
    177
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.
    See ya

    Ivy.

    MAC Codes


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •