|
The first page that loads does a Response.Write rsInventory("Machine_Name") and so on for the other fields and works properly. The "Machine_Name" is also defined as a link. When selected it takes the "ID" (an Autonumber field) and posts it to the update form which is were I'm having the problem. Here is the code:
***************************************************
'Dimension variables Dim adoCon 'Holds the Database Connection Object Dim rsInventory 'Holds the recordset for the record to be updated Dim strSQL 'Holds the SQL query for the database Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated lngRecordNo = CLng(Request.QueryString("ID"))
'Create an ADO connection odject Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("inventory.mdb")
'Set an active connection to the Connection object using DSN connection 'adoCon.Open "DSN=inventory"
'Create an ADO recordset object Set rsInventory = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database strSQL = "SELECT Desktop_Server.* FROM Desktop_Server WHERE ID LIKE" & lngRecordNo
'Open the recordset with the SQL query rsInventory.Open strSQL, adoCon %>
<html> <head> <title>Inventory Update Form</title> </head> <body bgcolor="white" text="black">
<!-- Begin form code --> <form name="form" method="post" action="update_entry.asp"> Machine Name: <input type="text" name="machine_name" maxlength="255" value="<% = rsInventory("Machine_Name") %>"><br> DFC Tag: <input type="number" name="DFC_ID" maxlength="20" value="<% = rsInventory("DFC_ID") %>"><br> Asset Name: <input type="text" name="Asset Name" maxlength="20" value="<% = rsInventory("Asset Name") %>"><br> Serial Number: <input type="text" name="Serial Number" maxlength="20" value="<% = rsInventory("Serial Number") %>"><br> CPU: <input type="text" name="CPU" maxlength="20" value="<% = rsInventory("CPU") %>"><br> Memory (Mb): <input type="number" name="Memory (Mb)" maxlength="20" value="<% = rsInventory("Memory (Mb)") %>"><br> HDD (Gb): <input type="number" name="HDD (Gb)" maxlength="20" value="<% = rsInventory("HDD (Gb)") %>"><br> Platform / PWTELLER: <input type="text" name="Platform / PWTELLER" maxlength="20" value="<% = rsInventory("Platform / PWTELLER") %>"><br> Inquiry: <input type="text" name="Inquiry" maxlength="20" value="<% = rsInventory("Inquiry") %>"><br> Premier II ITI: <input type="text" name="Premier II ITI" maxlength="20" value="<% = rsInventory("Premier II ITI") %>"><br> Premier Central / PWCRT: <input type="text" name="Premier Central / PWCRT" maxlength="20" value="<% = rsInventory("Premier Central / PWCRT") %>"><br> Accessory Printer: <input type="text" name="Accessory Printer" maxlength="20" value="<% = rsInventory("Accessory Printer") %>"><br> Monitor SN: <input type="text" name="Mon_SSN" maxlength="20" value="<% = rsInventory("Mon_SSN") %>"><br> Monitor DFC: <input type="text" name="Mon_DFC" maxlength="20" value="<% = rsInventory("Mon_DFC") %>"><br> <input type="hidden" name="ID" value="<% = rsInventory("ID") %>"> <input type="submit" name="Submit" value="Submit"> </form> <!-- End form code -->
</body> </html>
<% 'Reset server objects rsInventory.Close Set rsInventory = Nothing Set adoCon = Nothing %>
***************************************************
------------- Rob
VB/ASP Metamorphing Neophyte
|