|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Below is a script that works on a SQL server but NOT on MySQL for some reason. It seems to not like the "Set rstLogin = cnnLogin.Execute(strSQL)" line and get hung up there on any page I try to use the "Execute" Does anyone know anything that can help, I am taking pages that WORK from a site using SQL to modify and use on a site using MySQL
<%@ Language = "VBScript" %> <% Option Explicit Dim cnnLogin Dim rstLogin Dim strUserName, strPassword Dim strSQL %> <% If Request.Form("action") <> "validate_login" Then %> <!--#include file="Header2.asp" --> <form action="default.asp" method="post" name="login"> <input type="hidden" name="action" value="validate_login"> <table border="0" width="100%"> <tr> <td align="right">Login:</td> <td><input tabindex="1" type="text" name="user_name"></td> </tr> <tr> <td align="right">Password:</td> <td><input tabindex="2" type="password" name="password" maxlength="15"></td> </tr> <tr> <td align="right"></TD> <td><input tabindex="3" type="submit" VALUE="Login"></td> </tr> </table> </form> <% Else strSQL = "SELECT * FROM webusers " _ & "WHERE user_name='" & Replace(Request.Form("user_name"), "'", "''") & "' " _ & "AND password='" & Replace(Request.Form("password"), "'", "''") & "';" Set cnnLogin = Server.CreateObject("ADODB.Connection") cnnLogin.Open "Provider=MySQLProv;Data Source=10.1.1.20;" _ & "Database=peco;User ID=root;Password=password;" 'Set rstLogin = cnnLogin.Execute(strSQL) Set rstLogin = cnnLogin.Execute(strSQL) If Not rstLogin.EOF Then strUserName = Request.Form("user_name") Session("user_name") = strUserName %> <!---HTML CONTENT STARTS HERE--> <!--#include file="Header.asp" --> <!---Set Session UserName--> <p> <font size="4" face="arial,helvetica"><strong> Login Verified </strong></font> </p> <!---//Set Session UserName--> <!--#include file="Footer.asp" --> <% Else %> <!--include file="Header2.asp" --> <p> <font size="4" face="arial,helvetica"><strong> Login Failed - Please verify username and password. </strong></font> </p> <p> <a href="default.asp">Try Again</a> </p> <!--#include file="Footer.asp" --> <% Response.End End If ' Clean Up rstLogin.Close Set rstLogin = Nothing cnnLogin.Close Set cnnLogin = Nothing End If %> <!--#include file="Footer.asp" --> |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > SQL to MySQL problem using Execute |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|