Results 1 to 13 of 13

Thread: asp woes

  1. #1
    Senior Member Robert's Avatar
    Join Date
    Oct 2005
    Location
    North West
    Posts
    1,004
    Thanks
    2
    Thanked
    9 times in 5 posts
    • Robert's system
      • Motherboard:
      • Asus P6X58D Premium
      • CPU:
      • Intel i7 920
      • Memory:
      • Corsair 12GB Dominator 1600Mhz
      • Storage:
      • 10TB
      • Graphics card(s):
      • Nvidia GTX 480
      • PSU:
      • Corsair AX1200
      • Case:
      • Corsair 800D
      • Operating System:
      • Windows 7 HP Retail
      • Monitor(s):
      • Eizo SW110W+
      • Internet:
      • Virgin Media 100Mb

    asp woes

    I'm trying to work my way through a tutorial provided by the university. This basically allows you to convert a table from Access to ASP (exporting the table to ASP). Now I export the table to asp and put it into my local host folder. The problem is when I run it through FF it screws up (http://localhost/Assignment/Categories.asp)


    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    /assignment/Categories.asp, line 12

    any ideas?

    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-1252">
    <TITLE>Categories</TITLE>
    </HEAD>
    <BODY>
    <%
    If IsObject(Session("NetskillsDB_conn")) Then
    Set conn = Session("NetskillsDB_conn")
    Else
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "NetskillsDB","",""
    Set Session("??NetskillsDB_conn") = conn
    End If
    %>
    <%
    If IsObject(Session("Categories_rs")) Then
    Set rs = Session("Categories_rs")
    Else
    sql = "SELECT * FROM [Categories]"
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, conn, 3, 3
    If rs.eof Then
    rs.AddNew
    End If
    Set Session("Categories_rs") = rs
    End If
    %>
    <TABLE BORDER=1 BGCOLOR=#ffffff CELLSPACING=0><FONT FACE="Arial" COLOR=#000000><CAPTION><B>Categories</B></CAPTION></FONT>

    <THEAD>
    <TR>
    <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Arial" COLOR=#000000>Category ID</FONT></TH>
    <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Arial" COLOR=#000000>Category Name</FONT></TH>
    <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Arial" COLOR=#000000>Description</FONT></TH>
    <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Arial" COLOR=#000000>Picture</FONT></TH>

    </TR>
    </THEAD>
    <TBODY>
    <%
    On Error Resume Next
    rs.MoveFirst
    do while Not rs.eof
    %>
    <TR VALIGN=TOP>
    <TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT style=FONT-SIZE:10pt FACE="Arial" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("CategoryID").Value)%><BR></FONT></TD>
    <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Arial" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("CategoryName").Value)%><BR></FONT></TD>
    <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Arial" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("Description").Value)%><BR></FONT></TD>
    <TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT style=FONT-SIZE:10pt FACE="Arial" COLOR=#000000><BR></FONT></TD>

    </TR>
    <%
    rs.MoveNext
    loop%>
    </TBODY>
    <TFOOT></TFOOT>
    </TABLE>
    </BODY>
    </HTML>

  2. #2
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    you're trying to use an existing, created, named ODBC connection. the error says in plain english that it doesn't know of the connection. OBDC allows you abstract access to different databases on a system

    the bigger question is "why is your university teaching you something as antique as HTML 3.x and ASP 3.0 - and badly at that"?

  3. #3
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts
    first off yell loudly at your uni for teaching you such a proprietry and structurally piss poor language.

    Really let them have it.

    If they where teaching you ASP.Net, that would be rather fantastic, I could even hook you up with a job for a small hedge group, because everyone is desperate for good developers.

    But the problem here is that you don't have the ODBC source set up.

    conn.Open

    the first parameter is the connection string. With this you have too have something that makes sense set up on the PC running the server.

    If you've been given an access DB file or something and told to run it on your PC, you need too set it up on your PC, you can do this from the ODBC applet in Administrative tools (or control panel).
    throw new ArgumentException (String, String, Exception)

  4. #4
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts
    Quote Originally Posted by directhex View Post
    you're trying to use an existing, created, named ODBC connection. the error says in plain english that it doesn't know of the connection. OBDC allows you abstract access to different databases on a system

    the bigger question is "why is your university teaching you something as antique as HTML 3.x and ASP 3.0 - and badly at that"?
    There are so few things hex and I see eye too eye on. There must be something in this here.

    out of curiosity, search the notes you've got for this course for "DSN".
    throw new ArgumentException (String, String, Exception)

  5. #5
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    <font> tags? capitalized tags? lack of speech marks?

    your tuition fees are being spent on crack cocaine, not competent staff

  6. #6
    Does he need a reason? Funkstar's Avatar
    Join Date
    Aug 2005
    Location
    Aberdeen
    Posts
    19,874
    Thanks
    630
    Thanked
    965 times in 816 posts
    • Funkstar's system
      • Motherboard:
      • Gigabyte EG45M-DS2H
      • CPU:
      • Intel Core2Quad Q9550 (2.83GHz)
      • Memory:
      • 8GB OCZ PC2-6400C5 800MHz Quad Channel
      • Storage:
      • 650GB Western Digital Caviar Blue
      • Graphics card(s):
      • 512MB ATI Radeon HD4550
      • PSU:
      • Antec 350W 80+ Efficient PSU
      • Case:
      • Antec NSK1480 Slim Mini Desktop Case
      • Operating System:
      • Vista Ultimate 64bit
      • Monitor(s):
      • Dell 2407 + 2408 monitors
      • Internet:
      • Zen 8mb
    Your code would also be faster if you used response.write for the HTML portions as opposed to opening and closing the ASP all the time

  7. #7
    Mostly Me Lucio's Avatar
    Join Date
    Mar 2007
    Location
    Tring
    Posts
    5,163
    Thanks
    443
    Thanked
    448 times in 351 posts
    • Lucio's system
      • Motherboard:
      • Gigabyte GA-970A-UD3P
      • CPU:
      • AMD FX-6350 with Cooler Master Seldon 240
      • Memory:
      • 2x4GB Corsair DDR3 Vengeance
      • Storage:
      • 128GB Toshiba, 2.5" SSD, 1TB WD Blue WD10EZEX, 500GB Seagate Baracuda 7200.11
      • Graphics card(s):
      • Sapphire R9 270X 4GB
      • PSU:
      • 600W Silverstone Strider SST-ST60F
      • Case:
      • Cooler Master HAF XB
      • Operating System:
      • Windows 8.1 64Bit
      • Monitor(s):
      • Samsung 2032BW, 1680 x 1050
      • Internet:
      • 16Mb Plusnet
    First thing I can see wrong is that the link you've posted has a capital A on Assignment and your code has a little a in it. That alone could stop the connection!

  8. #8
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    Quote Originally Posted by Lucio View Post
    First thing I can see wrong is that the link you've posted has a capital A on Assignment and your code has a little a in it. That alone could stop the connection!
    only on a case-sensitive (*nix) host

  9. #9
    Senior Member Robert's Avatar
    Join Date
    Oct 2005
    Location
    North West
    Posts
    1,004
    Thanks
    2
    Thanked
    9 times in 5 posts
    • Robert's system
      • Motherboard:
      • Asus P6X58D Premium
      • CPU:
      • Intel i7 920
      • Memory:
      • Corsair 12GB Dominator 1600Mhz
      • Storage:
      • 10TB
      • Graphics card(s):
      • Nvidia GTX 480
      • PSU:
      • Corsair AX1200
      • Case:
      • Corsair 800D
      • Operating System:
      • Windows 7 HP Retail
      • Monitor(s):
      • Eizo SW110W+
      • Internet:
      • Virgin Media 100Mb
    Quote Originally Posted by directhex View Post
    you're trying to use an existing, created, named ODBC connection. the error says in plain english that it doesn't know of the connection. OBDC allows you abstract access to different databases on a system

    the bigger question is "why is your university teaching you something as antique as HTML 3.x and ASP 3.0 - and badly at that"?
    It maybe plain English but I've never used this before and from time to time errors can mean different things.

    I have setup a local host folder in XP pro and a test.asp file works for me.

    Edit: This tutorial says to export a table from Access to ASP and then run it through your browser to see if it displays the info correctly. The above code is copied from the said converted Access file.
    Last edited by Robert; 22-04-2007 at 09:07 PM.

  10. #10
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    Quote Originally Posted by Robert View Post
    It maybe plain English but I've never used this before and from time to time errors can mean different things.

    I have setup a local host folder in XP pro and a test.asp file works for me.

    Edit: This tutorial says to export a table from Access to ASP and then run it through your browser to see if it displays the info correctly. The above code is copied from the said converted Access file.
    then your tutorial is garbage.

    what the code you pasted is doing is:
    1. connect to an ODBC database named "NetskillsDB" which could be of any type (e.g. MySQL, MSSQL)
    2. create a recordset of all values in the "Categories" table
    3. move through recordset, one record at a time, showing the 3 values from it (CategoryID, CategoryName, Description)


    nothing is "converted", nothing is specifying Access rather than another database system. every time you visit the page, a new ODBC connection is made, and the whole thing runs again from scratch.

    and the HTML is utterly diabolical, and wrong in an enormous number of places

    if that's code being given at degree level for tutorials then you should make a complaint - i was writing cleaner, more up-to-date ASP when i was still at school, about 7 years ago

  11. #11
    Senior Member Robert's Avatar
    Join Date
    Oct 2005
    Location
    North West
    Posts
    1,004
    Thanks
    2
    Thanked
    9 times in 5 posts
    • Robert's system
      • Motherboard:
      • Asus P6X58D Premium
      • CPU:
      • Intel i7 920
      • Memory:
      • Corsair 12GB Dominator 1600Mhz
      • Storage:
      • 10TB
      • Graphics card(s):
      • Nvidia GTX 480
      • PSU:
      • Corsair AX1200
      • Case:
      • Corsair 800D
      • Operating System:
      • Windows 7 HP Retail
      • Monitor(s):
      • Eizo SW110W+
      • Internet:
      • Virgin Media 100Mb
    That code's autogenerated when I export the access table to ASP (Using export > MS Active Server Page).

  12. #12
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    Quote Originally Posted by Robert View Post
    That code's autogenerated when I export the access table to ASP (Using export > MS Active Server Page).
    i think i'm starting to get the picture now

    what's being exported is the VIEW of the table (or whatever the access terminology is) - not the data itself.

    are you generating this asp page on the same machine as you're testing it on?

  13. #13
    Senior Member Robert's Avatar
    Join Date
    Oct 2005
    Location
    North West
    Posts
    1,004
    Thanks
    2
    Thanked
    9 times in 5 posts
    • Robert's system
      • Motherboard:
      • Asus P6X58D Premium
      • CPU:
      • Intel i7 920
      • Memory:
      • Corsair 12GB Dominator 1600Mhz
      • Storage:
      • 10TB
      • Graphics card(s):
      • Nvidia GTX 480
      • PSU:
      • Corsair AX1200
      • Case:
      • Corsair 800D
      • Operating System:
      • Windows 7 HP Retail
      • Monitor(s):
      • Eizo SW110W+
      • Internet:
      • Virgin Media 100Mb
    Yes. I've got it to display correctly now. But I have a new problem..the tutorial says to change something like

    sql = "SELECT * FROM [Categories]"

    change to

    sql = "SELECT CategoryID FROM [Catgegories]"

    Then the only part of the table to be populated would be the category ID column. It does nothing though..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ASP querystring database query
    By pritsey in forum Software
    Replies: 2
    Last Post: 30-12-2006, 01:31 AM
  2. Replies: 4
    Last Post: 18-03-2005, 05:03 PM
  3. ASP Help required
    By TomWilko in forum Software
    Replies: 1
    Last Post: 27-10-2004, 02:36 PM
  4. Learning ASP
    By TomWilko in forum Software
    Replies: 9
    Last Post: 02-10-2004, 04:28 PM
  5. Asp Q?
    By joshwa in forum Software
    Replies: 6
    Last Post: 28-08-2003, 12:50 AM

Posting Permissions

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