If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Need help whit a connect string to mysql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-25-02, 08:33
hellur hellur is offline
Registered User
 
Join Date: Nov 2002
Posts: 10
Question Need help whit a connect string to mysql

Well my probs is that I have installed mysql and its work but now to problem I coding in asp and need a connection to the mysql

<%
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& _
Server.MapPath("ops.mdl")
Set dbcon = Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.recordset")
dbcon.open strConnect
%>

This you use for access databas but how do I do one for mysql ? someone have a answere pls answere
Reply With Quote
  #2 (permalink)  
Old 11-25-02, 09:39
Mulligan Mulligan is offline
Registered User
 
Join Date: Jul 2002
Posts: 55
Download and install MyODBC (link from MySQL.com) and follow the instructions. You can't connect to MySQL using OLEDB or any of the native providers. Install it, set up a DSN and do it that way.

edit: example from an ASP page connecting to MySQL
Code:
	Set cn = Server.CreateObject("ADODB.Connection")
	Set rs = Server.CreateObject("ADODB.RecordSet")
	' option=16384 forces MyODBC to cast BIGINT to INT for count(*) statements - ADO can't handle BIGINTs
	cn.Open "Driver={mySQL}; Server=10.0.0.1; Port=3306; Option=16384; Socket=; Stmt=; Database=databasename; Uid=username; Pwd=yourpassword;"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On