ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 13th, 2003, 07:39 AM
RobinR RobinR is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: New Jersey
Posts: 77 RobinR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 2 m 21 sec
Reputation Power: 6
Lightbulb MS Access, mySql and ASP

According to “Beginning Active Server Pages 3.0” from Wrox, Data Source Names
“are a largely outdated method of specifying connection details, mainly because they use ODBC drivers instead of OLE-DB providers to handle the data. We include them here only because you may come across DSNs when working with legacy systems.”

Which is better: using ODBC with a mySql database or not using ODBC with this type of database?

Also, based on the model below, how do you create a connection to a mySql database (using myODBC and not using myODBC)? Please note that I will be testing the database on my PC but it will also be used on a website.

Also, how do you handle the Sql?

Thanks for any help you can offer,

Robin
*************************************************

Example for connecting to an MS Access database:

<%

Set objCmd=Server.CreateObject("ADODB.Command")

Set objConn=Server.CreateObject("ADODB.Connection")

objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =" &_
Server.mappath("databases\ws_shopping.mdb")
%>

Example SQL:

<%

Set objRS1 = Server.CreateObject("ADODB.Recordset")

CartQuery = "SELECT CUSTID, INUM, ORDERDATE, CARTQTY " & _
"FROM ShoppingCart " & _
"WHERE CUSTID = '" & logName & "' " & _
"ORDER BY INUM "

objRS1.Open CartQuery, objConn, adOpenKeyset, adLockOptimistic, adCmdText

Set objCmd.ActiveConnection = objConn
MaxCustQuery = "SELECT MAX(CNUM) AS MaxCNum FROM Customers"

objCmd.CommandType = adCmdText
objCmd.CommandText = MaxCustQuery
Set rsMax = objCmd.Execute

If Not IsNull (rsMax("MaxCNum")) Then
intCNum = rsMax("MaxCNum")
End If


%>

Reply With Quote
  #2  
Old November 13th, 2003, 09:02 AM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,959 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 15 h 59 m 14 sec
Reputation Power: 802
You need to get the MyODBC drivers for MySQL. Download links and documentation are at www.mysql.com

I think there are some (not free) OLEDB drivers for MySQL somewhere but I've never used them.

There are occasions where DSN's are a good thing!

Reply With Quote
  #3  
Old November 13th, 2003, 11:09 AM
RobinR RobinR is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: New Jersey
Posts: 77 RobinR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 2 m 21 sec
Reputation Power: 6
I downloaded the mySql manual from www.mySql.com and didn't see any connection string or code for ASP.

Robin

Reply With Quote
  #4  
Old November 13th, 2003, 01:55 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,959 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 15 h 59 m 14 sec
Reputation Power: 802
Try the MyODBC documentation.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > MS Access, mySql and 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
Stay green...Green IT