awinstead
asked on
[Microsoft][ODBC dBase Driver]Invalid precision value
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("U RL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request. QueryStrin g)
MM_valUsername = CStr(Request.Form("kt_logi n_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_pas sword")
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.ActiveConnec tion = MM_CellSell_STRING
Response.Write("SQL: " & MM_loginSQL & "<br/>")
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.A ppend MM_rsUser_cmd.CreateParame ter("param 1", 200, 1, 255, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.A ppend MM_rsUser_cmd.CreateParame ter("param 2", 200, 1, 255, Request.Form("kt_login_pas sword")) ' 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_UserAuthorizat ion") = CStr(MM_rsUser.Fields.Item (MM_fldUse rAuthoriza tion).Valu e)
Else
Session("MM_UserAuthorizat ion") = ""
End If
if CStr(Request.QueryString(" accessdeni ed")) <> "" And true Then
Session("URL_His") = Request.QueryString("acces sdenied")
MM_redirectLoginSuccess = "intra.asp"
End If
MM_rsUser.Close
Response.Redirect(MM_redir ectLoginSu ccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redir ectLoginFa iled)
End If
%>
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("U
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.
MM_valUsername = CStr(Request.Form("kt_logi
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_pas
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.ActiveConnec
Response.Write("SQL:
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.A
MM_rsUser_cmd.Parameters.A
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_UserAuthorizat
Else
Session("MM_UserAuthorizat
End If
if CStr(Request.QueryString("
Session("URL_His") = Request.QueryString("acces
MM_redirectLoginSuccess = "intra.asp"
End If
MM_rsUser.Close
Response.Redirect(MM_redir
End If
MM_rsUser.Close
Response.Redirect(MM_redir
End If
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Did this help awinstead?
ASKER
Thank you! Sorry for the delay I have many projects going. I appreciate all your help!
Check the datatypes involved in this query.
This error has been discussed and answered here on EE before
https://www.experts-exchange.com/questions/23078390/ODBC-Drivers-error-'80040e21'-Invalid-Precision-Value.html?sfQueryTermInfo=1+invalid+precis+valu
https://www.experts-exchange.com/questions/22436921/Access-ODBC-error-on-date-field-Invalid-Precision-Value.html?sfQueryTermInfo=1+invalid+precis+valu
https://www.experts-exchange.com/questions/21886137/Invalid-precision-value-ASP-insert-into-Access-DB.html?sfQueryTermInfo=1+invalid+precis+valu