Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Location
    vizag
    Posts
    11

    Smile Unanswered: connection string

    hi to all,

    when i try to create connection string to connect mysql from vb it is giving error "object required" ..
    this is the code tht i used

    ConStr.open "Driver={mySQL ODBC 3.51 Driver}; Server=11.148.431.217;Database=test;Uid=root;Pwd=; "

    i am able to connect thru DSN..

    so please provide me the solution how to coonect thru connection string

    kalyan sekhar

  2. #2
    Join Date
    Nov 2002
    Location
    Ohio
    Posts
    90
    It doesn't sound like you initialized Constr before using it:

    Set Constr = New Connection

    Good Luck,
    Bruce Baasch

  3. #3
    Join Date
    Nov 2002
    Posts
    10

    Re: connection string

    strConnect = "DRIVER={MySQL ODBC 3.51 Driver};"_
    & "SERVER=localhost;" & " DATABASE=nameofdatabase;"_
    & "UID=name;PWD=password; OPTION=16384"
    Set dbcon = Server.CreateObject("ADODB.Connection")
    Set rs=Server.CreateObject("ADODB.recordset")
    dbcon.open strConnect

    sql="select * from sometablename"
    rs.open sql,dbcon,1,2
    rs.close

    Well this will work I think work fine nice for me!

Posting Permissions

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