Results 1 to 9 of 9

Thread: problems connecting to MySQL db

  1. #1
    Join Date
    Jan 2005
    Location
    Mexico
    Posts
    111
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default problems connecting to MySQL db

    Hi,

    It works fine in my machine. Not in this server. I think the problem is where ill highlight with black

    Code:
    <!-- #INCLUDE VIRTUAL="adovbs.inc" -->
    <script LANGUAGE="JavaScript" RUNAT="Server">
     
    ........... had tu cut it.............
     
    </script>
    <%
    Dim ItemsPerPage
    ItemsPerPage=10
    Dim tmpVar,tmpVar2,connstr,strSQL
    Dim recCount,startItem,curItem,iCol
    tmpVar = Request( "match" )
    GetMatchParameters( tmpVar )
    tmpVar = Request( "search" )
    GetSearchParameters( tmpVar )
    If len( Request("start") ) > 0 Then
    startItem = CInt( Request("start") )
    Else
    startItem = 0
    End If
    GetOutputStart( startItem )
    tmpVar = CStr( Request("searWords") )
    SplitSearWords( tmpVar )
    GetItemsPerPage( ItemsPerPage )
    GetSearchFileName( Request.ServerVariables("SCRIPT_NAME") )
    Set DataConn = Server.CreateObject("ADODB.Connection")
    Set DataRst = Server.CreateObject("ADODB.Recordset")
    DataRst.CursorLocation = adUseClient
    connstr = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=HYDROGEN;"_ 
    & " DATABASE=mydb;UID=blabla;PWD=mypass; OPTION=16387"
    dataconn.open connstr
    strSQL = ConstruSQL()
    If strSQL <> "" Then
     
    DataRst.Open strSQL, DataConn, 1
    recCount = DataRst.RecordCount
    SetTotHitPageNum( recCount ) 
    curItem = 0
    If recCount > 0 Then
    DataRst.MoveFirst
    DataRst.Move startItem
    Do While (Not DataRst.EOF) AND curItem < ItemsPerPage
    iCol = 0
    Do While iCol < 7
    tmpVar = DataRst.fields(iCol)
    GetCurRecItem(tmpVar)
    iCol = iCol + 1
    Loop
    curItem = curItem+1
    DataRst.MoveNext
    Loop 
    End If
    DataRst.Close
    Set DataRst = Nothing
    DataConn.Close
    Set DataConn = Nothing
    SortResult()
    OutPut("ASP")
    End If
    %>
    it gives me this error page: http://dechihuahua.com/buscar.asp?searWords=visitantes

    Hope anybody can help
    Last edited by Warren Ashcroft; 9th February 2005 at 11:37 PM.
    ĦMay all be for the good of humanity!
    http://www.dechihuahua.com
    Community of Chihuahua, Mexico
    ---------- (50%)

  2. #2
    Join Date
    Jan 2005
    Location
    Mexico
    Posts
    111
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    I´ve also created de db and the username form the helm control panel. That´s not the problem, I´ve already tested with other db´s on this server and work fine.
    ĦMay all be for the good of humanity!
    http://www.dechihuahua.com
    Community of Chihuahua, Mexico
    ---------- (50%)

  3. #3
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Hello There,
    I dont see any problems on that page? Just a few Secure Folder prompts where the page is trying to get things from a secured directory...

    Regards
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  4. #4
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    However, I use this connection string in my ASP scripts, for connecting to MySQL databases.

    Set Conn = CreateObject("ADODB.Connection")
    Conn.Open = "DRIVER={MySQL};SERVER=HYDROGEN;DATABASE=database; UID=username;PWD=password;OPTION=35;"

    The driver is different, but shouldnt be the problem, as 3.51 drivers are also installed.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  5. #5
    Join Date
    Jan 2005
    Location
    Mexico
    Posts
    111
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default ĦAll set now!

    The problem was a litte number:

    ....
    Set DataRst = Server.CreateObject("ADODB.Recordset")
    DataRst.CursorLocation = adUseClient
    connstr = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=HYDROGEN;"_
    & " DATABASE=mydb;UID=blabla;PWD=mypass; OPTION=16387"
    dataconn.open connstr
    strSQL = ConstruSQL()
    If strSQL <> "" Then
    DataRst.Open strSQL, DataConn, 1 (<-- That one) I replaced it with DataConn,3,3

    recCount = DataRst.RecordCount
    SetTotHitPageNum( recCount )
    curItem = 0
    If recCount > 0 Then
    DataRst.MoveFirst
    DataRst.Move startItem
    Do While (Not DataRst.EOF) AND curItem < ItemsPerPage
    iCol = 0
    Do While iCol < 7
    tmpVar = DataRst.fields(iCol)
    GetCurRecItem(tmpVar)
    ...


    This was turning me crazy. I don´t really remeber what those numbers are for. Aren´t they for the type of connection oppening or something like that. I widh anybody could recommend me a tutorial about this. The strange thing is that the prevoius way, it did work on my personal computer. Strange.

    Well, thank you for your time.
    ĦMay all be for the good of humanity!
    http://www.dechihuahua.com
    Community of Chihuahua, Mexico
    ---------- (50%)

  6. #6
    Join Date
    Jan 2005
    Location
    Mexico
    Posts
    111
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Secure Folder prompts ???

    I dont see any Secure Folder prompts
    ĦMay all be for the good of humanity!
    http://www.dechihuahua.com
    Community of Chihuahua, Mexico
    ---------- (50%)

  7. #7
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Its always something small

    From Microsoft:
    http://msdn.microsoft.com/library/de...mthrstopen.asp

    That little number is:
    CursorType
    Optional. A CursorTypeEnum value that determines the type of cursor that the provider should use when opening the Recordset. The default value is adOpenForwardOnly.

    CursorType Values:
    http://msdn.microsoft.com/library/de...ortypeenum.asp

    In simple terms, CursorType sets wheter the SQL query is inputting data, getting data, or both.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  8. #8
    Join Date
    Jan 2005
    Location
    Mexico
    Posts
    111
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Yes it´s allways something small.


    Thank you for the link and patience Warren
    This script I´m using is for a search engine. If anybody wants it, I attached it.
    Attached Files Attached Files
    Last edited by terraqueotenaz; 10th February 2005 at 01:15 AM.
    ĦMay all be for the good of humanity!
    http://www.dechihuahua.com
    Community of Chihuahua, Mexico
    ---------- (50%)

  9. #9
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    WinZip says its corrupt
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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