0

I am receiving the following error on my ASP login

Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/vdateUsr.asp, line 47

The data is being entered in a form and checked in a Access database. Here is the code:

' variables

dim cnStr

dim rcSet

dim frmUsername

dim frmPassword

dim sqlStr

dim strSQL

'store form input into variables

frmUsername = Request.Form("username")
frmPassword = Request.Form("password")

'create connection and recordset objects

Set cnStr = Server.CreateObject("ADODB.Connection")
Set rcSet = Server.CreateObject("ADODB.Recordset")

' defining database connection (connectionstring.asp)

cnStr.ConnectionString = path
cnStr.Provider = provider
cnStr.open

' execute sql and open as recordset

sqlStr = "Select * From users where [User Name] = ('" & frmUsername & "') and [Password] = ('" + frmPassword + "')"

strSQL="SELECT startup site FROM users WHERE [User Name] = ('" & frmUsername & "') and [Password] = ('" & frmPassword & "')"

' Opens the returned values from the SQL as a recordset, ready for iteration by ASP

'Line 47 below

set rcSet = cnStr.Execute(sqlStr)

Any help would be appreciated.

Thanks in advance

user692942
  • 16,398
  • 7
  • 76
  • 175
Mike Eide
  • 1
  • 1
  • 1
    add a line before line 47 that reads `response.write(sqlSTR)` and a 2nd line `response.end`. Then look at the SQL that is output... does is look like frmusername and frmpassword have values? Additionally... Seriously look into using paramaterized queries. This has SQL injection problems which lead to site hacks. Here's how: http://stackoverflow.com/questions/770419/how-to-make-a-parametrized-sql-query-on-classic-asp – xQbert Aug 28 '14 at 17:41
  • Also would [recommend this](http://stackoverflow.com/a/21698468/692942) explains some techniques in detail you can use over and over again. – user692942 Aug 28 '14 at 18:19

1 Answers1

0

We had this exact error, when loading from Excel to store in SQL Server. The cause was that we used column [F6] which didn't exist in the source Excel (the file format had changed). So, a "parameter" can be a column.

Kip Bryan
  • 461
  • 4
  • 6