Solved

[Microsoft][ODBC dBase Driver]Invalid precision value

Posted on 2008-10-22
4
709 Views
Last Modified: 2012-06-21
Hello everyone,
I have a dbase database that I am trying to query for a login to a website. I am using ASP with IIS. When I try to query the database to match the logins I get en error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

[Microsoft][ODBC dBase Driver]Invalid precision value



I am using the following code:

<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")

If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("kt_login_user"))
If MM_valUsername <> "" Then
  Dim MM_fldUserAuthorization
  Dim MM_redirectLoginSuccess
  Dim MM_redirectLoginFailed
  Dim MM_loginSQL
  Dim MM_rsUser
  Dim MM_rsUser_cmd
 
  MM_fldUserAuthorization = ""
  MM_redirectLoginSuccess = "intra.asp"
  MM_redirectLoginFailed = "login1.asp"
  Session("URL_His") = ""
 
  Login_User = MM_valUsername
  Login_Pass = Request.Form("kt_login_password")


 
  MM_LoginSQL = "SELECT CUSTMAIL.DIRCODE, CUSTMAIL.EMAIL, CUSTMAIL.WEBPASS, CUSTOMER.SREP_CODE, CUSTMAIL.ORDERENTRY, CUSTMAIL.DEFAULT_E, CUSTOMER.COMPANY FROM CUSTMAIL INNER JOIN CUSTOMER ON CUSTMAIL.DIRCODE = CUSTOMER.DIRCODE WHERE (((CUSTMAIL.DIRCODE) Between '7A' And '7Z'))) AND CUSTMAIL.EMAIL = ? AND CUSTMAIL.WEBPASS = ?"



If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization

 
  Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
  MM_rsUser_cmd.ActiveConnection = MM_CellSell_STRING
  Response.Write("SQL:&nbsp;" & MM_loginSQL & "<br/>")
 
 
  MM_rsUser_cmd.CommandText = MM_loginSQL
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 255, MM_valUsername) ' adVarChar
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 255, Request.Form("kt_login_password")) ' adVarChar
  MM_rsUser_cmd.Prepared = true
  Set MM_rsUser = MM_rsUser_cmd.Execute

  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
      Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And true Then
      
      Session("URL_His") = Request.QueryString("accessdenied")
      MM_redirectLoginSuccess = "intra.asp"
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
0
Comment
Question by:awinstead
  • 3
4 Comments
 
LVL 7

Expert Comment

by:Norush
ID: 22784229
0
 
LVL 7

Accepted Solution

by:
Norush earned 500 total points
ID: 22784238
0
 
LVL 7

Expert Comment

by:Norush
ID: 22829118
Did this help awinstead?
0
 

Author Closing Comment

by:awinstead
ID: 31508959
Thank you! Sorry for the delay I have many projects going. I appreciate all your help!
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question