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 February 11th, 2003, 05:36 AM
sudhi_75 sudhi_75 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Bangalore
Posts: 1 sudhi_75 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question ASP with MySql

Hi,

I would like to have the code through which I can connect to MySql database in ASP. I am able to connect through VB but when I try to use the same connection string in ASP, I am getting an error saying that it is an invalid attribute.

Anyone please let me know about this at the earliest.

Reply With Quote
  #2  
Old February 25th, 2004, 09:38 AM
jayshah jayshah is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 5 jayshah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Here is the code you want

Hi,

Can you send me the code that connects VB to MySQL. Here is the code for ASP to MySQL connection.

--------------------------------------------------------------------------
<%@ Language=VBScript %>
<%
Dim my_conn, strSQL, rs
Set my_conn = createobject("ADODB.Connection")

my_conn.open = "DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=localhost;"_
& "DATABASE=C:\Program Files\mysql\data\wine;"_
& "UID=root;"_
& "PWD=;"

strSQL = "SELECT * FROM wine"

Set rs = conn.Execute(strSQL)

' Do until it reaches end of db

Do while not rs.eof
Response.Write "Name: " & rs("customers") & "<br>"
'Response.Write "FirstName: " & rs("FirstName") & "<br>"
'Response.Write "LastName: " & rs("LastName") & "<br>"

rs.MoveNext 'Next record
loop

my_conn.close ' Close database connection
Set my_conn = nothing 'obj variable released

%>


--------------------------------------------------------------------------------

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > connect to MySql database in ASP


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 1 hosted by Hostway