Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL and ASP using MS Access 2000 1

Status
Not open for further replies.

gnibbles

Programmer
Mar 15, 2000
79
0
0
CA
I am trying to query a database to return the name field in a database (access 2000) based upon a query. The following is what I have coded thus far:<br>
<br>
&lt;%'form info<br>
SoftID=CInt(request.form(&quot;SoftID&quot;))<br>
CDID=CInt(request.form(&quot;CDID&quot;))<br>
HDDID=CInt(request.form(&quot;HDDID&quot;))<br>
MouseID=CInt(request.form(&quot;MouseID&quot;))<br>
KeyboardID=CInt(request.form(&quot;KeyboardID&quot;))<br>
MonitorID=CInt(request.form(&quot;MonitorID&quot;))<br>
FDDID=CInt(request.form(&quot;FDDID&quot;))<br>
RAMSize=CInt(request.form(&quot;RAMSize&quot;))<br>
VideoID=CInt(request.form(&quot;VideoID&quot;))<br>
CPUID=CInt(request.form(&quot;CPUID&quot;))<br>
'RAMSize=CInt(RAMSize)<br>
'sending data off to the database<br>
<br>
set conn=server.createobject(&quot;ADODB.connection&quot;)<br>
set objRS = server.createobject(&quot;ADODB.recordset&quot;)<br>
<br>
conn.open &quot;DSN=Custom System&quot;<br>
<br>
Response.write(Request(&quot;CPUID&quot;))<br>
SQLstmt = &quot;select Name from CPU where CPUID=(CPUID)&quot; <br>
Set RS = conn.execute(SQLstmt)<br>
%&gt;<br>
I am not sure where the name value is going. Could anyone help me with this? <br>
Norbert
 
<br>
rs.fields(&quot;Name&quot;)<br>
<br>
<br>
<br>
<p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
When I say rs.fields("Name")<br>
I get the error <br>
Microsoft VBScript runtime error '800a01b6' <br>
<br>
Object doesn't support this property or method: 'fields' <br>
<br>
/databaseproject/Script/webpageASP.asp, line 28 <br>

 
That's strange. it should have worked. Technically, you can also say rs(&quot;Name&quot;), since the fields collection is the default for the recordset object. <br>
<br>
By the way, the line <br>
<br>
set objRS = server.createobject(&quot;ADODB.recordset&quot;)<br>
<br>
isn't necessary. You're not doing anything with that recordset. The execute method is creating another recordset object named RS. When doing things this way, there's no need to explicitly create the recordset object beforehand. It gets created as a result of the .execute.<br>
<br>
<p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
In this line<br>
SQLstmt = &quot;select Name from CPU where CPUID=(CPUID)&quot; <br>
<br>
Did you mean<br>
<br>
Sqlstmt = &quot;select Name from CPU where (CPUID=&quot; & CPUID & &quot;)&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top