Solved

[Microsoft][ODBC dBase Driver]Invalid precision value

Posted on 2008-10-22
4
712 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

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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 informatio…

751 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