Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.