Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Type Mismatch?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Type Mismatch?

 Post Reply Post Reply Page  <12
Author
2gawd View Drop Down
Newbie
Newbie
Avatar

Joined: 27 August 2003
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote 2gawd Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2003 at 1:12pm

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
%>

***************************************************

Back to Top
Mikeap View Drop Down
Newbie
Newbie


Joined: 12 March 2003
Location: United States
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mikeap Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2003 at 9:18pm

I am still getting my TYPE MISMATCH on the following:

For iCounter = 0 to 16
R1Team(iCounter) = arrRound1(3,iCounter)
If IsNull(R1Team(iCounter)) or IsEmpty(R1Team(iCounter)) Then
R1Team(iCounter) = "None"
End If
Next

arrRound1 being my arry which is equal to a GetRow statement (recordset)

On the second line of the above is where I'm getting the TYPE MISMATCH.

R1Team(iCounter) = arrRound1(3,iCounter)

What I'm trying to do is collect information into a variable.  So R1Team(0) would be = arrRound1(3,0) which would keep all information "aligned" and I would be pulling the right stuff.



Edited by Mikeap
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.