Results 1 to 9 of 9

Thread: connect to mySQL with VB.Net

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    Delhi, India
    Posts
    47

    connect to mySQL with VB.Net

    hi all
    i'm trying to connect a mySQL server (not on my local machine) from VB.Net using OLEDB Connection.
    the connection string used is :
    Code:
    Provider=MySQLProv;Data Source=mySQLDB;User Id=myusername;password=mypassword;"
    the error my prog shows is "MySQLProv not supported by local machine."
    do i have to download it explicitly ??? i dont have to use ODBC at all. plz help

  2. #2

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    Delhi, India
    Posts
    47
    ok...i've downloaded the OLEDB3.0 and have installed it too.
    now when i run, it asks for the data Source name....is this the DSN or the server name ?? i've provided the default..it shows the error : No error information available:E_FAIL(0x80004005)

    plz help me n lemme know what am i doing wrong

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Here's a quick link, hope it helps.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    Delhi, India
    Posts
    47
    hi...well i know the connection string and everything.
    the problem i'm facing is that when i give the details..a dialog box appears when the application starts which requires the database name details. as my database is not on the local machine, i have given the location in the connection string but i on connecting i get the error : No error information available.

    Do i have to make a DSN...i dont want to...can u guys help me here
    the conn string i use is :
    Code:
    Provider=MySQLProv;Location=IP Address;Data Source:mydatabase;Username=uid;Password=pwd

  6. #6

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    Delhi, India
    Posts
    47
    please ppl i need ur help here.....what am i doing wrong ???
    my setup is as follows:

    i've downloaded and installed myOLEDB3 and have registered myProv.dll

    the connection string i'm using is:
    Code:
    Dim SQLConn As New OleDbConnection()
    strSQLConn = "Provider=MySQLProv;Location=IPAddress where the mySQL database is;Data Source=database_name;User Id=uid;Password=pwd"
    SQLConn.ConnectionString = strSQLConn
    SQLConn.Open()
    the connection doesn't open...when i run the prog, i get a kind of dialog box which is for the data source name details, it has a column ofr datasource name which has default written in it, the other columnsa are filled with the details i gave. when i click on connect on that dialog box, the error i get is:
    Code:
    No error information available:E_FAIL(0x80004005)
    c'mon ppl help me out here

  7. #7

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    Delhi, India
    Posts
    47
    ok..i had to make a DSN to get it work....the connection is working and i'm able to do what i wanna.

    now my second question is..is there a way i can make the DSN on the fly..i mean the user wont have to explicitly make it...the vb.net code makes it for him. he just have to provide the server name, the usre id, password, dsn name and the database(thru an interface)
    waiting for ur replies...but remember in vb.net
    Last edited by amNewatVB; Mar 15th, 2004 at 02:53 AM.

  8. #8
    Hyperactive Member stingrae's Avatar
    Join Date
    Apr 2002
    Location
    Sydney
    Posts
    401
    i'm trying to do it now, but can't get past point 1.

    question: "where do i download/install the MySQLProv Providor from?"

    reason is, that i'm getting this error:

    An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll

    Additional information: The 'MySQLProv' provider is not registered on the local machine.
    "The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.

    Windows & Web Developer
    Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
    Sutherland Shire, Sydney Australia
    www.stingrae.com.au
    Developer of Arnold - Gym & Martial Arts Database Management System
    www.gymdatabase.com.au

  9. #9
    Hyperactive Member stingrae's Avatar
    Join Date
    Apr 2002
    Location
    Sydney
    Posts
    401
    Ok, I just got the providor. Now how do I create a DSN?
    "The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.

    Windows & Web Developer
    Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
    Sutherland Shire, Sydney Australia
    www.stingrae.com.au
    Developer of Arnold - Gym & Martial Arts Database Management System
    www.gymdatabase.com.au

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width