Jump to content

Search the Community

Showing results for tags 'Access database'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH


  • Community Calendar

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 1 result

  1. Hi,I am trying to create an asset management system using HTML, ASP and MS Access. I am testing all on this with IIS. Every thing is held on my local machine. I am having two problems at the moment. The database (Assets.mdb) is held in "c:/assets.mdb" and my HTML page and the two ASP pages are held in "C:\Inetpub\wwwroot\TestWeb" which is the default path for IIS. Problem 1:When I try to display all details of the assets held in the table, the asset number which is the primary key, is not displayed in the format I have set it. I have set the asset number as an Auto Number and formatted it as follows: "TACD"0000. When I add a new record directly in to the table, the numbers are set as TACD0001, TACD0002 etc... However when I display the table in my .asp page all information is served correctly except for the Asset Number which only shows up as 1, 2, 3 etc... Any idea on how I can rectify this? I have followed the ASP tutorial and the ADO tutorial on the website but I cant seem to fix this. The code I have used is as follows: <body> <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "c:/Assets.mdb" set rs=Server.CreateObject("ADODB.recordset") rs.Open "SELECT AssetNumber, Title, Classification, Author, Version, Date, NumberOfDisks, Distribution, Location, Description, Notes FROM cdinventory", conn %> <table border="1" width="100%"> <tr> <% for each x in rs.Fields response.write("<th>" & x.name & "</th>") next %> </tr> <% do until rs.EOF %> <tr> <% for each x in rs.Fields %> <td><% Response.Write(x.Value) %></td> <% next rs.MoveNext %> </tr> <% loop rs.close conn.close %> </table> </body> Problem 2:I have a form in a HTML page which takes the details of a new asset from a user and sends it to an .asp page once the submit button is hit. The thing is that the record is not created and only displays the error message that I have specified. inventory.html <html> <head> <title>Inventory System</title> <link rel="stylesheet" type="text/css" href="inventorystyle.css" /> <link rel="shortcut icon" href="favicon.ico" /> </head> <body> <h1>Inventory System</h1> <form method="post" action="addasset.asp"> <table> <tr> <td>Title:</td> <td><input name="title"></td> </tr> <tr> <td>Classification:</td> <td> <select name="classification"> <option value="blank">Select One</option> <option value="operatingsystem">Operating System</option> <option value="applicationsoftware">Application Software</option> <option value="drivercd">Driver CD</option> </select> </td> </tr> <tr> <td>Author:</td> <td><input name="author"></td> </tr> <tr> <td>Version:</td> <td><input name="version"></td> </tr> <tr> <td>Date:</td> <td><input name="date"></td> </tr> <tr> <td>Number Of Disks:</td> <td><input name="numberofdisks"></td> </tr> <tr> <td>Distribution:</td> <td><input name="distribution"></td> </tr> <tr> <td>Location:</td> <td><input name="location"></td> </tr> <tr> <td>Description:</td> <td><textarea name="description"></textarea></td> </tr> <tr> <td>Notes:</td> <td><textarea name="notes"></textarea></td> </tr> </table><br /><br /> <input type="submit" value="Add"> <input type="reset" value="Cancel"> </form> </body></html> addasset.asp<html><body><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "c:/Assets.mdb"sql="INSERT INTO cdinventory (Title,Classification,"sql=sql & "Author,Version,Date,NumberOfDisks,Distribution,Location,Description,Notes)"sql=sql & " VALUES "sql=sql & "('" & Request.Form("title") & "',"sql=sql & "'" & Request.Form("classification") & "',"sql=sql & "'" & Request.Form("author") & "',"sql=sql & "'" & Request.Form("version") & "',"sql=sql & "'" & Request.Form("date") & "',"sql=sql & "'" & Request.Form("numberofdisks") & "',"sql=sql & "'" & Request.Form("distribution") & "',"sql=sql & "'" & Request.Form("location") & "',"sql=sql & "'" & Request.Form("description") & "',"sql=sql & "'" & Request.Form("notes") & "')"on error resume nextconn.Execute sql,recaffectedif err<>0 then Response.Write("Error while adding new record!")else Response.Write("<h3>" & recaffected & " record added successfully!</h3>")end ifconn.close%></body></html> Any help on these two issues will be greatly appreciated. Thanks in advance.
  • Create New...