Forum Moderators: open
Second if I'm breaking any of the rules by posting variables that relate to my website I'm sorry!
Basically I have the following code:
[Code]
<% If Request.Querystring("ModelID") <> "" Then %>
<%metavar = request("ModelID")%>
<%'Response.Buffer = false%>
<%
'Create database connection object (Advanced Data Objects)
Set MyMetaConn = server.createobject("ADODB.connection")
MyMetaConn.Open session("dataconn")
Set RsMeta = server.createobject("ADODB.recordset")
Set RsMeta.activeconnection = MyMetaConn
'Define the source SQL code for the recordset
RsMeta.source = " SELECT Appliance.ModelID, Appliance.ModelNo, Manufacturer.Manufacturer "
RsMeta.source = RsMeta.source & " FROM Manufacturer INNER JOIN Appliance ON Manufacturer.ManufacturerCode = Appliance.ManufacturerCode "
RsMeta.source = RsMeta.source & "WHERE (((Appliance.ModelID)= '" & metavar & "') AND (Not (Appliance.Exclude)=Yes));"
RsMeta.open , , 1, 3
%>
<%Do While not RsMeta.EOF%>
Response write some stuff (Removed cos it might break rules)
<%RsMeta.MoveNext%>
<%Loop%>
<%RsMeta.Close%>
<%Else%>
Do Stuff
<%End If%>
Right that fails.
NOw I think that it's cos the field ModelID is an autonumber which is a Long Int and the bit i get from page.asp?modelid=****x is not. Any way round this?
Thanking you for you time!
RsMeta.source = RsMeta.source & "WHERE (((Appliance.ModelID)= '" & metavar & "') AND (Not (Appliance.Exclude)=Yes));"
RsMeta.source = RsMeta.source & "WHERE (((Appliance.ModelID)= " & metavar & ") AND (Not (Appliance.Exclude)=Yes));"