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!

Expected end of statement 1

Status
Not open for further replies.

vprog

Programmer
Jul 9, 2003
3
0
0
US
I am new to VBScript. I was trying write the following code but could not figure out error here. Please help. following is the code
I get
Expected end of statement line 19, column 8

Dim strConnect
Dim objCommand, objRS , intNoofRecords
Dim dtStartDt,dtEndDt,strCounty

Set objCommand = Server.CreateObject("ADODB.Command") ' create the Command object

' fill in the command properties
objCommand.ActiveConnection = strConnect

dtStartDt = Request.Form("eleStartDt")
dtEndDt = Request.Form("eleEndDt")
strCounty = Request.Form("elecounty")

Dim str = "SELECT * FROM Participant"
response.write(str)
objCommand.CommandText = "SELECT * FROM Participant"
' objCommand.CommandText = "SELECT * FROM Participant WHERE Analysis_Date BETWEEN " & dtStartDt & "AND" '& dtEndDt & " AND County = " & 'strCounty'
objCommand.CommandType = adCmdText

' now execute the command, and capture the selected records in a recordset
Set objRS = objCommand.Execute intNoofRecords

' The Command object has done its job, so clean it up
Set objCommand = Nothing

If intNoofRecords > 5 Then
' now loop through the records
While Not objRS.EOF
Response.Write objRS("Analysis_Date") & ": " & objRS("County") & "<BR>"
objRS.MoveNext
Wend
' now close and clean up
objRS.Close
Set objRS = Nothing
Else
msg = "There should be at least 5 participants to analyse the data"
Response.write ("<" & "script language=VBScript>")
Response.write ("Msgbox """ & msg & """<" & "/script>")
' now close and clean up
objRS.Close
Set objRS = Nothing
Response.Redirect "newApplication.asp"
End If
 
>Dim str = "SELECT * FROM Participant"
[tt]Dim str
str = "SELECT * FROM Participant"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top