Solved

[Microsoft][ODBC dBase Driver]Invalid precision value

Posted on 2008-10-22
4
707 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
Comment Utility
0
 
LVL 7

Accepted Solution

by:
Norush earned 500 total points
Comment Utility
0
 
LVL 7

Expert Comment

by:Norush
Comment Utility
Did this help awinstead?
0
 

Author Closing Comment

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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now