MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old November 26th, 2004, 04:24 PM
faithwarren faithwarren is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 1 faithwarren User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question SQL to MySQL problem using Execute

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" -->

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > SQL to MySQL problem using Execute


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway