How to connect to Remote MySQL Server via ASP? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to connect to Remote MySQL Server via ASP?

gizzugizzu Posts: 42Member
Well, first question: Is it possible to connect to a remote MySQL Server via ASP?

Second question, if yes: What connection string should I use?

These are the connection strings for the most nearest purposes I've found:



OLE DB Provider for mySQL

oConn.Open "Provider=MySQLProv;" & _
"Data Source=mySQLDB;" & _
"User Id=myUsername;" & _
"Password=myPassword"


For SQL Server

oConn.Open "Provider=MSDASQL;" & _
"Driver={SQL Server};" & _
"Server=myServerName;" & _
"Database=myDatabaseName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"

To connect to SQL Server running on a remote computer (via an IP address)

oConn.Open "Provider=sqloledb;" & _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"


Comments

  • JonathanJonathan Posts: 2,914Member
    Hi,

    : Well, first question: Is it possible to connect to a remote MySQL
    : Server via ASP?
    Yup, it will be. :-)

    : Second question, if yes: What connection string should I use?
    :
    : These are the connection strings for the most nearest purposes I've found:
    :
    :
    :
    : OLE DB Provider for mySQL
    :
    : oConn.Open "Provider=MySQLProv;" & _
    : "Data Source=mySQLDB;" & _
    : "User Id=myUsername;" & _
    : "Password=myPassword"

    That may do it, the main thing is that you need to have the ODBC driver or some other database driver for the MySQL server installed. Check the MySQL site and look for something called myODBC (I think).

    Good luck,

    Jonathan


    -------------------------------------------
    Count your downloads:
    http://www.downloadcounter.com/
    And host your site:
    http://www.incrahost.com/
    Don't say I never give you anything... ;-)

Sign In or Register to comment.