?
Solved

[Microsoft][ODBC dBase Driver]Invalid precision value

Posted on 2008-10-22
4
Medium Priority
?
719 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 7

Accepted Solution

by:
Norush earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

719 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