MySQL Forums
Forum List  »  Connector/ODBC

This is driving me crazy - perhaps bad parameters ?
Posted by: Jim Plante
Date: March 22, 2005 02:14PM

I have been dealing with a problem for about 2 weeks and it is driving me crazy. Any help would be appreciated.
Its probably not difficult to solve and is probably a parameters I have wrong, but being new to MySQL I cant seem to get this to work consistantly.

First I will tell you what I'm trying to do, then you can tell me why this isn't working.
The actual site is: http://www.repointing.com/referral/

If you want to log on and give it a test, use the following sample accounts:

[sample account #1]
username: test1-1
password: test1-2

[sample account #2]
username: test2-1
password: test2-2


Go to the site, log-in as user 1. Do view job listings, log-out, close the browser, log-in again, refresh the browser, and so on.
SWITCH and log-in as user 2, and do same stuff, then back to user 1, etc.. Rinse and repeat

The entire site is not up due to this testing, but the problem is simply trying to log in so that should be enough to see what I mean. The other errors that occur within the rest of the app are always the same error I have below

Sooner or later, maybe after 2 or 3 times, it will crash with this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
ODBC driver does not support the requested properties.
/referral/login.asp, line 25


where line 25 refers to this line:
rs.Open "SELECT * FROM contractors WHERE username='"&cUsername&"' AND password='"&cPassword&"';",oConn,3,2


The default page is a simple default.html that gets a username and password and passes it along to login.asp in Request.Form
In login.asp the user name and password are checked and flow is redirected depending on different things
home.asp - login looks good
default.html - some problem with log-in
login_inactive.html - the record was found but flagged as inactive.
login_notfound.html - User name and/or password not found or wrong


----------------------------------
Here is login.asp code:
I removed some info, of course, like passwords and stuff. I do not know where i got the connection string,
so maybe its not correct to begin with.
----------------------------------

<%@ Language = "VBScript" %>
<% Response.Expires = -1 %>
<% Response.Buffer = True %>

<%
Dim cReDirect
cReDirect = "home.asp"

Dim cUsername, cPassword
cUsername = LCase(Trim(Request.Form("txtUsername")))
cPassword = LCase(Trim(Request.Form("txtPassword")))

If cUsername = "" OR cPassword = "" Then
Response.Redirect("default.html")
End If

Dim oConn
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("DRIVER={MySQL ODBC 3.51 Driver};SERVER=orf-mysql1.brinkster.com;PORT=3306;DATABASE=*****;USER=*****;PASSWORD=*****;OPTION=3;")

Dim rs
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "SELECT * FROM contractors WHERE username='"&cUsername&"' AND password='"&cPassword&"';",oConn,3,2

If rs.EOF Then
cReDirect = "login_notfound.html"
Else
If rs("status") <> "A" Then
cReDirect = "login_inactive.html"
End If
End If

rs.Close
oConn.Close

Set rs = Nothing
Set oConn = Nothing

Response.Redirect(cReDirect)
%>


I continue to get the error mentioned above. Sometimes when I fill in user name and password info, it simply
returns to the default.html as if the user name and password fields were left empty.

This error occurs time and time again in other programs, and it always seem to circle around statements like this:
rs.Open "SELECT * FROM contractors WHERE username='"&cUsername&"' AND password='"&cPassword&"';",oConn,3,2
or this
rs.Open "SELECT COPUNT(*) AS recs FROM tablename WHEREa=b;",oConn,3,2

Perhaps I need to open the tables differently ? or my connection string is bad or something ?


When asked what version of MySQL my host (brinkster.com) is using they told me it is:
Windows Server 2003 with MySQL 4.0

Options: ReplyQuote


Subject
Written By
Posted
This is driving me crazy - perhaps bad parameters ?
March 22, 2005 02:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.