Hi!
This part is wrong:
else
sqltext = "select * from empdir"
sqltext = sqltext & "WHERE LIKE '" & varfind & "';"
TheMessage = "Search Results"
end if
After WHERE there has to be something....and I should use = instead of LIKE
Ex: sqltext =sqltext & "WHERE yourfield = '" & varfind & "'
Hth,
Hakan
-----Ursprungligt meddelande-----
Från: PUFFER, TIM [mailto:TIM.PUFFER@T...]
Skickat: den 9 november 2001 18:40
Till: ASP Databases
Ämne: [asp_databases] RE: VBS runtime error
I am just learning this ASP stuff, so if I ask a dumb question bear with me.
but as you can see I am try to clean this code up and use some of the
appropriate techniques. How would I, using the proper technical, execute
the SQL statement.
-----Original Message-----
From: Kyle Burns [mailto:kburns@c...]
Sent: Friday, November 09, 2001 10:45 AM
To: ASP Databases
Subject: [asp_databases] RE: VBS runtime error
Your "Else" clause does not execute the SQL statement and create rsEmps.
=================================
Kyle M. Burns, MCSD, MCT
ECommerce Technology Manager
Centra Credit Union
kburns@c...
-----Original Message-----
From: PUFFER, TIM [mailto:TIM.PUFFER@T...]
Sent: Friday, November 09, 2001 11:34 AM
To: ASP Databases
Subject: [asp_databases] RE: VBS runtime error
Here is the script part of my asp
<%
'varFind = request.form("find")
'varin = request.form("in")
'response.write varfind
'response.write varin
set rscn = server.createobject ("adodb.connection")
cn = "driver={microsoft access driver (*.mdb)};" & _
"dbq=" & server.MapPath("thermo.mdb")
rscn.open cn,"", ""
if Request.QueryString("view") = "All" then
set rsEmps = rscn.Execute("select * from empdir")
TheMessage = "All Employees"
elseif Request.QueryString("view") = "Department" then
set rsEmps = rscn.Execute("select * from empdir where Department
'" _
& Request.QueryString("Department") & "'")
TheMessage = "For Department " & Request.QueryString("Department")
else
sqltext = "select * from empdir"
sqltext = sqltext & "WHERE LIKE '" & varfind & "';"
TheMessage = "Search Results"
end if
%>
Again thanks for the help.
> -----Original Message-----
> From: tim.puffer@t... [mailto:tim.puffer@t...]
> Sent: 08 November 2001 21:03
> To: ASP Databases
> Subject: [asp_databases] VBS runtime error
>
>
> here is my problem i get a runtime error from this code and i
> am not sure
> what it is looking for.
>
> here is the error
>
> Microsoft VBScript runtime error '800a01a8'
> Object required: ''
>
> /phone/results.asp, line 76
>
>
> and this is line 76
> <%
> While not rsemp.EOF
>
> %>
>
> thanks in advance
>
>
> steve.carter@t...
> $subst('Email.Unsub')
>
tim.puffer@t...
$subst('Email.Unsub')
$subst('Email.Unsub')
tim.puffer@t...
$subst('Email.Unsub')